Skip to content

DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools#177

Merged
RomFloreani merged 12 commits into
mainfrom
DEVOPS-1060
May 13, 2026
Merged

DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools#177
RomFloreani merged 12 commits into
mainfrom
DEVOPS-1060

Conversation

@RomFloreani
Copy link
Copy Markdown
Contributor

@RomFloreani RomFloreani commented May 12, 2026

DEVOPS-1060 - in github, exception on jira number check for automatic PR Bumping CI-tools

Copilot AI review requested due to automatic review settings May 12, 2026 12:48
@RomFloreani RomFloreani changed the title DEVOPS-1060: DEVOPS-1060 : May 12, 2026
@github-actions github-actions Bot changed the title DEVOPS-1060 : DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools May 12, 2026
Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR updates the reusable GitHub Actions workflow that derives a Jira issue key from PR metadata and then updates/validates the PR accordingly, primarily by tightening job execution conditions.

Changes:

  • Update get_issue_key job gating to skip Dependabot PRs using github.actor and github.head_ref.
  • Gate add_jira_summary so it only runs when get_issue_key succeeded and the PR action is opened.
  • Gate check_jira_issue so it only runs when get_issue_key succeeded.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@RomFloreani RomFloreani changed the title DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools WIP May 12, 2026
@RomFloreani RomFloreani changed the title DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools WIP DEVOPS-1060: in github, exception on jira number check for automatic PR Bumping CI-tools May 12, 2026
@RomFloreani RomFloreani requested a review from sebhmg May 12, 2026 17:51
@RomFloreani
Copy link
Copy Markdown
Contributor Author

RomFloreani commented May 12, 2026

Updated code has expected behavior on:
https://github.com/MiraGeoscience/GMS/pull/970

Copy link
Copy Markdown
Contributor

@sebhmg sebhmg left a comment

Choose a reason for hiding this comment

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

see suggestion and question

Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
@RomFloreani
Copy link
Copy Markdown
Contributor Author

Summary of changes to reusable-jira-pr_actions.yml

  • Skip branch extraction for Dependabot branches — branches like dependabot/... contain patterns that falsely match the Jira key regex (e.g. TOOLS-8978044). Branch extraction is now skipped for these.
  • Fail get_issue_key when no Jira key is found — previously the workflow silently passed. Now it fails with a clear error unless the PR is from an expected bot (Dependabot bump or pre-commit-ci config update).
  • check_jira_issue and add_jira_summary skip when get_issue_key fails — avoids running downstream jobs unnecessarily.
  • add_jira_summary now runs when a human pushes to a bot-created PR — with idempotency so it only runs once even on subsequent commits.
  • Replaced github.actor with github.event.sender — functionally identical for pull_request events but uses the event payload instead of runtime context, resolving the zizmor bot-conditions security warning.

Testing

Tested manually via commits pointing to tag v3.4.3-alpha.1:

  • No Jira key in titleget_issue_key fails with a clear error, check_jira_issue and add_jira_summary are skipped as expected.
  • Jira key added to title + empty commit — workflow passes, check_jira_issue validates the issue correctly.
  • Branch named after Jira issue (e.g. DEVOPS-1060) — key extracted from branch, title auto-updated, summary added on first commit, correctly skipped on subsequent commits (idempotency confirmed).
  • add_jira_summary on human commit to Dependabot PR — summary generated correctly when a Jira key is present in the title.

Not tested:

  • Pure Dependabot-authored PRs (no human commits) — cannot be tested without Dependabot pointing to the test tag, which requires a human commit to update the reference.
  • pre-commit-ci bot — cannot be simulated manually as github.event.sender.login would be the tester's username, not pre-commit-ci[bot].

@RomFloreani RomFloreani requested a review from sebhmg May 13, 2026 16:23
Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
Copy link
Copy Markdown
Contributor

@sebhmg sebhmg left a comment

Choose a reason for hiding this comment

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

see note about dependabot group names

Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
Comment thread .github/workflows/reusable-jira-pr_actions.yml Outdated
@RomFloreani RomFloreani merged commit 4dfe763 into main May 13, 2026
10 checks passed
@RomFloreani RomFloreani deleted the DEVOPS-1060 branch May 13, 2026 20:14
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.

3 participants