Skip to content

Add GHAS code scanning severity to Jira issue label - #131

Draft
maritiren wants to merge 3 commits into
github:mainfrom
maritiren:forward-severity-label
Draft

maritiren wants to merge 3 commits into
github:mainfrom
maritiren:forward-severity-label

Conversation

@maritiren

@maritiren maritiren commented Sep 14, 2026

Copy link
Copy Markdown

This feature adds the severity label to the Jira issue.

The severity label is needed for project managers/whoever prioritizes tasks to prioritize the findings into sprints.

We discussed whether to write the labels with or without the severity- prefix. We figured we'd keep a clear language. See the example:

severity-label

Copilot AI balanced review requested due to automatic review settings September 14, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Label synchronization can delete unrelated user-managed labels beginning with severity-.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds GitHub code-scanning severity labels to Jira issues and keeps them synchronized.

Changes:

  • Derives severity from code-scanning rules.
  • Adds or updates severity-* Jira labels.
  • Documents label synchronization behavior.
File summaries
File Description
sync.py Passes alert severity during synchronization.
jiralib.py Creates and updates severity labels.
ghlib.py Extracts alert severity.
README.md Documents severity labels.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread jiralib.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Configured labels can collide with managed severity labels, causing issues to retain multiple contradictory severities.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

jiralib.py:197

  • Configured Jira labels are concatenated with the managed severity without excluding the reserved severity values. For example, jira_labels: severity-high creates a low-severity alert with both severity-high and severity-low, so the issue no longer has the single current severity described in the README. Reject/reserve these values in jira_labels, or filter managed severity labels from self.labels before appending the alert's current severity.

This issue also appears on line 316 of the same file.

jiralib.py:316

  • This loop re-adds any managed severity value present in jira_labels immediately after line 315 removes stale severity labels. Thus an existing low-severity issue remains labeled severity-high and severity-low when severity-high is configured, instead of replacing the stale value. Exclude or reject managed severity labels from configured labels before merging the current severity.
        for label in self.labels + severity_labels(severity):
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@maritiren
maritiren marked this pull request as draft September 14, 2026 16:09
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