Skip to content

[BUG] gh-issues CI status counts duplicate/superseded check runs #176

Closed as not planned

Description

@gerchowl

Bug

just gh-issues PR table CI column shows incorrect status because statusCheckRollup from gh pr list includes all check runs, including re-runs of the same check.

Example

PR #175 has Validate PR Title appearing 3 times in statusCheckRollup:

  • Validate PR Title → FAILURE (12:52:49)
  • Validate PR Title → FAILURE (12:53:39)
  • Validate PR Title → SUCCESS (12:53:52)

The table shows ✗ 1/3 Validate PR Title, Validate PR Title (red) when GitHub's PR page shows the check as passing (only the latest run matters).

Expected

Deduplicate statusCheckRollup by check name, keeping only the latest result (by completedAt), so the CI column matches what GitHub shows on the PR page.

Affected code

  • scripts/gh_issues.py → _format_ci_status()

Related

Activity

  1. added
    bug
    area:workflow
    effort:small
    semver:patch
    on Feb 24, 2026
  2. self-assigned this
    on Feb 24, 2026
  3. gerchowl commented on Feb 24, 2026

    @gerchowl
    ContributorAuthor

    Design

    Problem

    statusCheckRollup from gh pr list includes all check runs, including re-runs. When a check fails twice then succeeds, the table shows red (✗ 1/3) instead of green (✓ 1/1) because we count duplicates.

    Solution

    Deduplicate statusCheckRollup by check name, keeping only the latest result. Use completedAt for ordering; if missing, treat as oldest (or last in list as fallback).

    Implementation

    • Add a helper _dedupe_status_checks(rollup: list[dict]) -> list[dict] that:
      • Groups by name
      • For each name, keeps the entry with the latest completedAt (ISO8601 string)
      • Entries without completedAt sort before those with it (or use list order as tiebreaker)
    • Call _dedupe_status_checks(rollup) at the start of _format_ci_status before existing logic.

    Testing

    • Add test: duplicate check names with different conclusions — latest (by completedAt) wins.
    • Add test: duplicate check names without completedAt — last occurrence wins (or first, document choice).
    • Existing tests remain green (they have no duplicates).
  4. gerchowl commented on Feb 24, 2026

    @gerchowl
    ContributorAuthor

    Implementation Plan

    Issue: #176
    Branch: bugfix/176-gh-issues-ci-dedup

    Tasks

    • Task 1: Add test for dedup — duplicate check names, latest by completedAt wins — tests/test_gh_issues.py — verify: uv run pytest tests/test_gh_issues.py::TestFormatCiStatus -v
    • Task 2: Add test for dedup fallback — duplicates without completedAt, last in list wins — tests/test_gh_issues.py — verify: uv run pytest tests/test_gh_issues.py::TestFormatCiStatus -v
    • Task 3: Implement _dedupe_status_checks helper — scripts/gh_issues.py — verify: tests pass
    • Task 4: Call _dedupe_status_checks in _format_ci_status — scripts/gh_issues.py — verify: just test && just lint && pre-commit run --all-files
  5. gerchowl commented on Feb 24, 2026

    @gerchowl
    ContributorAuthor

    CI Diagnosis

    Failing workflow: CodeQL Analysis (python) / Run CodeQL analysis
    Error: Code Scanning could not process the submitted SARIF file: CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled
    Root cause: Repo-level CodeQL configuration conflict — multiple workflows (codeql.yml, security-scan, scorecard, ci.yml) upload SARIF; GitHub rejects when advanced + default setup coexist.
    Planned fix: None in this PR — we did not modify any workflow files. This is a pre-existing configuration issue. Recommend opening a separate issue to resolve CodeQL workflow conflicts.

  6. gerchowl commented on Feb 24, 2026

    @gerchowl
    ContributorAuthor

    Autonomous Run Complete

    • Design: posted
    • Plan: posted (4 tasks)
    • Execute: all tasks done
    • Verify: gh_issues tests pass, lint pass, pre-commit pass (hadolint skipped locally — Docker not running)
    • PR: fix(gh-issues): deduplicate CI status by check name (#176) #177
    • CI: Build Container Image ✓, Python Security Scan ✓, Dependency Review ✓, Validate PR Title ✓. CodeQL Analysis (python) ✗ — pre-existing config conflict (see CI Diagnosis above). Project Checks ✗ — logs not yet available; our changes (scripts/gh_issues.py, tests) do not affect Project Checks pytest suite (test_utils, vig-utils).
  7. c-vigo commented on Jul 8, 2026

    @c-vigo
    Contributor

    Closing as part of an agreed backlog cleanup (with @gerchowl) — valid but dormant, no work in progress since the Nix migration. Reopen or refile fresh if picked up.

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

Metadata

Metadata

Assignees

Labels

area:workflowbugeffort:smallsemver:patch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions