Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Apply 'docsite_pr' Label #1537

Closed
wants to merge 2 commits into from

Conversation

sommersoft
Copy link
Contributor

@sommersoft sommersoft commented Mar 24, 2021

Addresses item two for #1193.

This will apply the docsite_pr label to pull requests that have been edited on GitHub, using the "Edit On GitHub" feature. Commits made via this feature carry a couple specific metadata items (see attachment).

I got lucky and there was an open PR on ansible/ansible that used this feature:

$ ./triage_ansible.py --dry-run --verbose --pr 74006 --logfile ../ansibot_log/log.txt --ignore_galaxy
2021-03-24 17:46:45,070 INFO 2938 ansible.py:__init__:225 starting bot
....
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:506 url: https://github.com/ansible/ansible/pull/74006
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:507 title: docs(#73995): fix broken link in doc
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:510 component[f]: lib/ansible/modules/user.py
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:523 needs_revision
{'cancel_ci': False,
 'cancel_ci_branch': False,
 'close': False,
 'close_migrated': False,
 'comments': [],
 'merge': False,
 'newlabel': ['docsite_pr', 'needs_ci', 'needs_revision'],
 'open': False,
 'rebuild': False,
 'rebuild_failed': False,
 'uncomment': [],
 'unlabel': ['core_review']}
Dry-run specified, skipping execution of actions
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:540 finished triage for https://github.com/ansible/ansible/pull/74006 in 9.247569s
2021-03-24 17:46:57,657 INFO 2938 ansible.py:run:544 triaged 1 issues in 9.982991 seconds
2021-03-24 17:46:57,657 INFO 2938 defaulttriager.py:start:148 stopping bot

Full run log and GitHub API response: docsite_pr_example.txt

Tagging @acozine

@sommersoft sommersoft changed the title Docsite pr label Apply 'docsite_pr' Label Mar 24, 2021
@mkrizek
Copy link
Collaborator

mkrizek commented Mar 26, 2021

Thanks!

I got lucky and there was an open PR on ansible/ansible that used this feature:

You could have also created a PR (via Edit on Github link) and indicate in the PR description that it is to test the bot.

Just a note, another way to determine whether to use the docsite_pr label would be to scan the description for +label: docsite_pr which is what is added (unless the submitter removes it...) automatically as a part of the PR template. We could get that "for free" if we implemented #1003.

I am fine with this. Anything to add from the docs team side, @acozine ?

Copy link
Collaborator

@mkrizek mkrizek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that there is a false positive for this PR ansible/ansible#73939. Sounds like we should include a unit test for a case where the label should not be applied?

@sommersoft
Copy link
Contributor Author

Just a note, another way to determine whether to use the docsite_pr label would be to scan the description for +label: docsite_pr which is what is added (unless the submitter removes it...) automatically as a part of the PR template. We could get that "for free" if we implemented #1003.

I thought this was already working. This brings up an intent question, I guess (more on that later). I might go ahead and make a new PR on ansible/ansible for testing/verification.

It appears that there is a false positive for this PR ansible/ansible#73939.

The second commit in that PR was done via Edit on GitHub (API link). This was likely direct-from-github.com, as opposed to being from docs.ansible.com.

The two things above drive a question of intent, for me. Is the desire to label/gather metrics for docsite_pr:

  1. Only from docs.ansible.com?
  2. Wider use, including both docs.ansible.com and direct-from-github.com?

@acozine and the DaWGs would need to answer this. Might be best to bring it up as an agenda item in a DaWGs meeting?

If the answer is item 1, then +label: docsite_pr would be the best way and this PR can be closed.


Sounds like we should include a unit test for a case where the label should not be applied?

Easy enough to just add another parametrized item.

@mkrizek
Copy link
Collaborator

mkrizek commented Mar 29, 2021

The two things above drive a question of intent, for me. Is the desire to label/gather metrics for docsite_pr:

  1. Only from docs.ansible.com?
  2. Wider use, including both docs.ansible.com and direct-from-github.com?

@acozine and the DaWGs would need to answer this. Might be best to bring it up as an agenda item in a DaWGs meeting?

Yes, thanks!

@mkrizek
Copy link
Collaborator

mkrizek commented May 20, 2024

I am going to close this PR as this project is no longer active and will be marked as read-only soon. Thank you for your contribution @sommersoft!

@mkrizek mkrizek closed this May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants