Skip to content

Conversation

@henrymercer
Copy link
Contributor

Refactor how we compute job status so this happens in a single place, and whether or not we have a CodeQL config. Also add comments to clarify what happens in the case that the CodeQL config is absent.

Risk assessment

For internal use only. Please select the risk level of this change:

  • High risk: Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.
  • Managed - Impacts users with dynamic workflows (Default Setup, CCR, ...).

Products:

  • Code Scanning - The changes impact analyses when analysis-kinds: code-scanning.
  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.
  • CCR - The changes impact analyses for Copilot Code Reviews.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency.
  • GHES - Impacts CodeQL workflows on GitHub Enterprise Server.

How did/will you validate this change?

  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

How will you know if something goes wrong after this change is released?

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner January 23, 2026 17:04
Copilot AI review requested due to automatic review settings January 23, 2026 17:04
@github-actions github-actions bot added the size/S Should be easy to review label Jan 23, 2026
- Move it out of the failed SARIF reporting so we compute the job status
whether or not we have a CodeQL config.
- Add comments to clarify what happens in the case that the CodeQL
config is absent.
@henrymercer henrymercer force-pushed the henrymercer/compute-job-status-if-no-config branch from c1f6643 to dcd1b12 Compare January 23, 2026 17:07
Copy link
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

Summary:
This PR refactors job status computation to centralize the logic in a single function (getFinalJobStatus) in init-action-post.ts, moving it from init-action-post-helper.ts where it was previously split across multiple functions. The refactoring adds clarifying comments about behavior when CodeQL config is absent.

Changes:

  • Moved and enhanced getFinalJobStatus function from init-action-post-helper.ts to init-action-post.ts, accepting a Config parameter to handle the case where config is undefined
  • Simplified tryUploadSarifIfRunFailed in init-action-post-helper.ts by removing job status setting logic
  • Fixed spelling from "analysing" to "analyzing" for consistency

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/init-action-post.ts Added centralized getFinalJobStatus function with improved logic and comments; fixed spelling consistency
src/init-action-post-helper.ts Removed job status setting logic from tryUploadSarifIfRunFailed; removed getFinalJobStatus export
lib/init-action-post.js Generated JavaScript (not reviewed per custom guidelines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants