Add workflow to check that issues tied to PRs have a milestone#2590
Add workflow to check that issues tied to PRs have a milestone#2590amontanez24 merged 15 commits intomainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2590 +/- ##
=======================================
Coverage 98.11% 98.11%
=======================================
Files 70 70
Lines 7275 7275
=======================================
Hits 7138 7138
Misses 137 137
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This Pull Request is not linked to an issue. To ensure our community is able to accurately track resolved issues, please link any that will be closed by this PR! |
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install requests==2.31.0 |
There was a problem hiding this comment.
Do we want to pin this? There's already been several new releases of requests.
There was a problem hiding this comment.
Can we test the scenario where a linked issue does not have a milestone?
scripts/check_milestone.py
Outdated
| def _post_comment(github_client: GithubClient, pr_number: int): | ||
| comment = ( | ||
| 'This Pull Request is not linked to an issue. To ensure our community is able to ' | ||
| 'accurately track resolved issues, please link any that will be closed by this PR!' |
There was a problem hiding this comment.
| 'accurately track resolved issues, please link any that will be closed by this PR!' | |
| 'accurately track resolved issues, please link any issue that will be closed by this PR!' |
scripts/check_milestone.py
Outdated
| if not issue.get('milestone'): | ||
| raise Exception(f'No milestone attached to issue number {issue.get("number")}') |
There was a problem hiding this comment.
Should we also verify that all issues are linked to the same milestone? I'm considering cases where a feature branch resolves many issues in one PR, and we may want to ensure they all have the same milestone.
| preparerelease: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Should we prevent this from being run on dependency updates?
| preparerelease: | |
| runs-on: ubuntu-latest | |
| preparerelease: | |
| runs-on: ubuntu-latest | |
| if: "!startsWith(github.head_ref, 'latest-dependency-update-')" |
scripts/check_milestone.py
Outdated
| ): | ||
| pr_number = pr_number | ||
| results = graph_client.query( | ||
| query=CLOSING_ISSUES_QUERY, owner='sdv-dev', repo='sdv', prNumber=pr_number |
There was a problem hiding this comment.
Should owner and repo be a global variable (at top, set once)?
scripts/release_notes_generator.py
Outdated
| query_params = {'milestone': milestone_title, 'state': 'all', 'per_page': 100} | ||
| response = requests.get(url, headers=headers, params=query_params, timeout=10) | ||
| response = client.get( | ||
| github_org='sdv-dev', repo='sdv', endpoint='milestones', query_params=query_params |
There was a problem hiding this comment.
Org and repo should be global variables
There was a problem hiding this comment.
Sorry missed this file
889098f to
13eb4d9
Compare
resolves #2585
Comment if issue not linked is below
Example run that errored because there was no milestone:
https://github.com/sdv-dev/SDV/actions/runs/15889541001/job/44809256289
Example run that passed from PR push
https://github.com/sdv-dev/SDV/actions/runs/15891716052