-
Notifications
You must be signed in to change notification settings - Fork 56
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
PHP to Python plus tests and stuff #51
PHP to Python plus tests and stuff #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I like the idea of centralising on a single coding language. We don't know if anyone will maintain the code, but at least we'll only need Python skills, which are more common than PHP skills. Also the addition of tests is really appreciated.
I've suggested various improvements. You may regard some of the larger ones as out of scope for this PR, in which case, please log an issue for each of the ones you choose not to address so these can be worked on in future. Alternatively, if you don't mind large PRs, please address all the comments here - your choice.
@cdransf PTAL as this is a substantial PR. |
Thanks for the review @glyn |
git config --global user.name "dark-visitors" | ||
git config --global user.email "[email protected]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these configs made here? And should they be changed for the conversion step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know (x2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the purpose of these configs is to make the changes produced by the dark visitors website look as if they were produced by a dark-visitors user. I'm not sure this is entirely necessary. The commit message should be sufficient on its own.
@fabianegli Thanks for the rework. A couple of remaining items for this PR:
|
@fabianegli To expand on remaining item 1: please make sure that updates due to dark visitors changes have an appropriate commit message (and user/email if you decide to keep that) and that updates due to merging a local change also have an appropriate commit message (and user/email). In other words, we need to make sure we differentiate between dark visitors and local changes, especially in the situation where a local change is merged and, coincidentally, dark visitors has changed. If we are not careful, the current code will pick up both changes and put them in a single commit and give that commit an incorrect commit message (and user/email). It may be necessary to step back from the approach in the current PR and keep the processing of dark visitors separate from the merging of local changes. It should still be possible to (a) replace the PHP by Python and (b) introduce tests of the Python functions. Hope that helps make the requirements clearer. |
Just gonna “Leeroy Jenkins” this and we’ll see what happens! |
It looks like the action ran without any issue. Not sure who can see this, but here’s the run that was triggered via the merge: https://github.com/ai-robots-txt/ai.robots.txt/actions/runs/11471373718 No changes to robots.json or robots.txt, though, but I can’t tell if that’s because there truly aren’t any new user agents to add or if something else happened. |
Will all changes now be attributed to dark visitors? |
I think there was indeed a change in the attribution logic. PR #58 reverts that. |
I am sorry it took me so long to come back to this and indeed this probably shouldn't have been merged in this way. FYI that's why I marked it to be a draft before I had to turn my attention to other things for a while. |
This PR changes the behaviour:
and some file contents slightly:
The python files have been formatted with black.