Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Spam Filtering Using Akismet. #615

Closed
wants to merge 7 commits into from
Closed

Support for Spam Filtering Using Akismet. #615

wants to merge 7 commits into from

Conversation

thousandtyone
Copy link
Contributor

PR Contains Fix as described in #599. Entire end to end flow has been tested and works. Here are the high level changes that are done:

  1. Migrated the Akismet projects using DotNet Upgrade Assistant. More information about this tool is at: https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview. The migration was smooth without any errors and the entire project was moved over to .NET Core 6.0.
  2. Wrote code to integrate with the project. (Very similar to the old DasBlog project). Note that some simple changes were done to fit in the correct structure. E.g. Akismet with spam moderation works fine and integrates in correct comment moderation framework. Without comment moderation, any spam detected by Akismet is stopped from getting posted using validations.
  3. Config file already had the right XML nodes present but the Models in CS files had some of those attributes commented to uncommented those.

The end to end flows work. More documentation with screenshot of how this works appended with the issue. Happy to make any other changes that you feel might be required.

Added support for Akismet integration.
Adding Akismet project to Solution to Build from with Visual Studio while building the solution.
Rolled back all changes other than adding Akismet project.
Simple code formatting and clean up for esthetics and readability.
…ering.

Included a top level check to not even check for spam if filtering service for spam detection is not set to true.
Upgrade of underlying target framework for the project.
@thousandtyone
Copy link
Contributor Author

thousandtyone commented Jan 28, 2022

I have submitted the PR but the checks keep failing with this log in the pipeline:

2022-01-28T20:39:26.9131489Z ##[section]Starting: DotNetCoreCLI
2022-01-28T20:39:26.9250902Z ==============================================================================
2022-01-28T20:39:26.9251488Z Task : .NET Core
2022-01-28T20:39:26.9251855Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2022-01-28T20:39:26.9252389Z Version : 2.198.0
2022-01-28T20:39:26.9252661Z Author : Microsoft Corporation
2022-01-28T20:39:26.9253034Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2022-01-28T20:39:26.9253428Z ==============================================================================
2022-01-28T20:39:27.3607660Z [command]C:\Windows\system32\chcp.com 65001
2022-01-28T20:39:27.3712512Z Active code page: 65001
2022-01-28T20:39:27.3742137Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2022-01-28T20:39:28.7256705Z [command]C:\hostedtoolcache\windows\dotnet\dotnet.exe publish D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj --configuration Release --output D:\a\1\a/dasblog-core_20220128.4 --self-contained --no-build --no-restore
2022-01-28T20:39:28.8986300Z Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
2022-01-28T20:39:28.8987756Z Copyright (C) Microsoft Corporation. All rights reserved.
2022-01-28T20:39:28.8988373Z
2022-01-28T20:39:31.2032819Z C:\hostedtoolcache\windows\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(248,5): error MSB3030: Could not copy the file "D:\a\1\s\source\Subtext.Akismet\bin\Release\net6.0\Subtext.Akismet.dll" because it was not found. [D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj]
2022-01-28T20:39:31.2426036Z ##[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1
2022-01-28T20:39:31.2429760Z ##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
2022-01-28T20:39:31.2434427Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2022-01-28T20:39:31.2437654Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj
2022-01-28T20:39:31.2571238Z ##[section]Finishing: DotNetCoreCLI

The Same command however works locally for me:

image

Not sure if I did something wrong or it's an issue with the pipeline in general. The whole flow is working perfectly on my machine and even seems to be passing build and test cases in the pipeline. Not sure why publish is failing. Right now I tried the same set of commands the pipeline is firing on my local machine and it all seems to work. If there is something that needs to be fixed at my end please do let me know and I'll be happy to fix. Not sure why the publish is unable to find the akismet dll on the pipeline box. I am leaving the PR open. It'll be really nice if you can review it once and please do let me know if I am doing something wrong or it's some issue that needs to be fixed on the pipeline. If I need to fix it, I'll do that right away.

@thousandtyone
Copy link
Contributor Author

Documentation Available here: #599 (comment)

@poppastring
Copy link
Owner

@thousandtyone Thx for the PR. Sorry I took so long to respond. I will take a look at this in the next day or so.

@poppastring
Copy link
Owner

poppastring commented Mar 26, 2022

@thousandtyone Again thanks for your patience. I have been told I need to fix an issue with the build (Framework dependency is broken).

So my plan at first was to attempt to resolve this issue at the same time, but in all honesty I am feeling less comfortable about making Akismet part of the dasblog project directly. I have spent a lot of time trying to narrow the focus to the essential and necessary and just consume Nuget packages. Here are my thoughts:

  1. Create a new github repo for Akismet
  2. Develop the pipeline to create a Nuget package
  3. Consume the package in dasblog

I am not sure how you feel about doing this work, I also do not want to assume that I can just take your Akismet project and just make a Nuget package under my Github name (I am really happy to do this but again, how do you feel?). Please let me know which way you would prefer to go.

Again, thanks for your contributions!

@poppastring poppastring closed this Sep 5, 2022
@thousandtyone
Copy link
Contributor Author

thousandtyone commented Nov 3, 2022

@poppastring Really sorry about the rather late response on this one. I am absolutely fine with taking any direction you would want to take. Please feel free to take my work and make a nuget package under your github name. No worries! As long as dasblog gets akismet support we all benefit from it! :)

Also if there is any way in which I can further contribute or help please feel free to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants