Skip to content

Add atomic PR ID job - Python tool POC #212

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

joseph-flinn
Copy link
Contributor

@joseph-flinn joseph-flinn commented Nov 22, 2023

🎟️ Tracking

Testing idea of atomic and testable workflow jobs

🚧 Type of change

  • 🚀 New feature development
  • 🤖 Build/deploy pipeline (DevOps)

📔 Objective

Add an atomic job to pull the PR ID that is associated with a commit SHA built in Python with a full suite for testing (POC;: should be thrown out if we want to adopt something like this).

📋 Code changes

  • .github/jobs-py: new directory with script and supporting tests for those job scripts
  • .github/workflows/test_jobs_py.yml: CI pipeline to test changes to the python automation jobs

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@joseph-flinn joseph-flinn requested a review from a team as a code owner November 22, 2023 19:48
@joseph-flinn joseph-flinn marked this pull request as draft November 22, 2023 19:48
Copy link

sonarqubecloud bot commented Sep 4, 2024

@mimartin12 mimartin12 requested a review from Copilot April 9, 2025 17:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 12 out of 15 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • .github/jobs-py/.env.example: Language not supported
  • .github/jobs-py/.gitignore: Language not supported
  • .github/jobs-py/shell.nix: Language not supported
Comments suppressed due to low confidence (2)

.github/jobs-py/src/get_pr_id.py:20

  • [nitpick] The regex pattern assumes that commit messages contain exactly one PR reference in the format '(#)'. This approach can be brittle if the format changes or if multiple instances appear; consider improving the pattern's robustness or handling multiple matches explicitly.
result = re.search(r"(\(#\d+\))", message)

.github/jobs-py/src/get_pr_id.py:26

  • [nitpick] There is no test case that simulates a GithubException being raised (e.g., due to an invalid commit SHA or authentication failure). Adding a unit test for this exception path would improve test coverage.
except GithubException:


load_dotenv()

auth = Auth.Token(os.getenv("GITHUB_TOKEN", default=""))
Copy link
Preview

Copilot AI Apr 9, 2025

Choose a reason for hiding this comment

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

Using an empty string as the default for GITHUB_TOKEN may result in silent authentication failures. Consider checking whether GITHUB_TOKEN is provided and raising an error if it's missing to avoid ambiguous failures later.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

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.

1 participant