Skip to content

Consolidate CI workflow branches#2659

Merged
arii merged 20 commits into
mainfrom
arii/workingbranch
Jun 20, 2026
Merged

Consolidate CI workflow branches#2659
arii merged 20 commits into
mainfrom
arii/workingbranch

Conversation

@arii

@arii arii commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Closes #2644
Closes #2637
Closes #2636

google-labs-jules Bot and others added 20 commits June 19, 2026 20:02
- Added `verify-changes` gate job to `ci.yml`, `deploy.yml`, and `codeql.yml`
- Gated heavy jobs behind `has_changes` output to save runner minutes
- Consolidated `security.yml` and `conflict-check.yml` into `ci.yml`
- Implemented `block-empty-jules-patches.yml` as global PR-closing failsafe
- Fixed `actions/checkout` version hallucinations across modified workflows
- Validated all workflow changes with `actionlint`
…workflows

- Lifted environment variables to job level in `ci.yml`.
- Created `scripts/lib/codeReviewUtils.ts` with shared code review logic.
- Refactored `geminiCodeReviewClient.ts` and `githubModelsCodeReviewClient.ts` to use shared utilities.
- Consolidated `parseVisualReviewFindings` in `scripts/lib/visualReviewUtils.ts`.
- Updated visual review clients to use the shared parser.
Hoisted MAX_AI_REVIEWS, GEMINI_API_KEY, GITHUB_TOKEN, GITHUB_REPOSITORY,
PR_NUMBER, and GITHUB_MODELS_MODEL to the job level in the impact-analysis job
of .github/workflows/ci.yml. This removes configuration duplication and
simplifies maintenance. Redundant step-level environment variables were
removed from the four separate review steps. Similar cleanup was performed
in the lint-typecheck and audit jobs for consistency.
- Refined `verify-changes` gate logic to use base-branch comparison for PRs.
- Updated all workflows to use `fetch-depth: 0` for accurate diff detection.
- Fixed `$GITHUB_OUTPUT` syntax and standardized `actions/checkout` to `@v4`.
- Consolidated security and merge-conflict checks into the main `ci.yml`.
- Maintained scheduled scan integrity in `codeql.yml`.
- Deployed a global `block-empty-jules-patches.yml` failsafe to auto-close empty PRs.
- Refined `verify-changes` logic to use base-branch comparison (`...`) for PRs.
- Standardized `actions/checkout` to `@v4` and ensured `fetch-depth: 0`.
- Fixed `actionlint`/`shellcheck` violations by double-quoting variables.
- Consolidated security and merge-conflict checks into the main gated `ci.yml`.
- Deployed a global `block-empty-jules-patches.yml` to auto-close empty PRs.
- Maintained scheduled scan integrity in `codeql.yml`.
…mits

- Consolidated environment variables to job level in `ci.yml`.
- Created `scripts/lib/codeReviewUtils.ts` with shared code review logic (system prompt, verdict/state parsing, token budgeting).
- Refactored `geminiCodeReviewClient.ts` and `githubModelsCodeReviewClient.ts` to use shared utilities.
- Consolidated `parseVisualReviewFindings` in `scripts/lib/visualReviewUtils.ts`.
- Increased token budgeting and truncation limits to 100,000 characters in `codeReviewUtils.ts` and `codeReviewOrchestrator.ts` to prevent truncation of large refactor diffs.
- Created `reusable-gate.yml` to centralize CI gating logic and enforce DRY principles.
- Refactored `ci.yml`, `deploy.yml`, and `codeql.yml` to utilize the reusable gate.
- Re-architected `block-empty-jules-patches.yml` to depend on the reusable gate for policy enforcement (auto-closing PRs).
- Secured shell scripts against injection by utilizing environment variables for context data.
- Added defensive checks for single-commit histories and explicit base-branch fetching.
- Standardized `actions/checkout` to `@v4` and ensured `fetch-depth: 0` for all gated workflows.
- Validated the complete workflow suite with `actionlint`.
- Reverted character limits to 24,000 to respect model constraints.
- Updated system prompt to instruct LLM not to fail reviews solely due to truncated context.
- Ensured all shared utilities are exported and correctly imported.
- Centralized gating logic into `.github/workflows/reusable-gate.yml`.
- Refactored `ci.yml`, `deploy.yml`, and `codeql.yml` to utilize the reusable gate.
- Refined `push` logic to use `github.event.before` for accurate multi-commit diffing.
- Implemented robust `pull_request` diffing against base branches (`...HEAD`).
- Deployed `block-empty-jules-patches.yml` as a global auto-closing PR failsafe.
- Secured shell scripts by utilizing environment variables for GitHub context data.
- Maintained `actions/checkout@v6` as per explicit repository requirement.
- Consolidated security scans and conflict checks into the main gated pipeline.
- Validated all workflow enhancements with `actionlint`.
Hoisted MAX_AI_REVIEWS, GITHUB_REPOSITORY, PR_NUMBER, and
GITHUB_MODELS_MODEL to the job level in the impact-analysis job of
.github/workflows/ci.yml.

Secrets (GEMINI_API_KEY and GITHUB_TOKEN) are maintained at the step
level to ensure correct propagation into the containerized execution
environment and to adhere to the principle of least privilege.

Redundant job-level environment variables were also removed from the
lint-typecheck and audit jobs for consistency.
- Lifted duplicated environment variables to the job level in `ci.yml`.
- Centralized code review logic in `scripts/lib/codeReviewUtils.ts`.
- Refactored review clients (Gemini and GitHub Models) to use shared utilities.
- Hardened token budgeting and improved system prompts to handle truncation gracefully.
- Consolidated visual review findings parsing in `scripts/lib/visualReviewUtils.ts`.
Hoisted common non-secret environment variables (CI, MAX_AI_REVIEWS,
GITHUB_MODELS_MODEL) to the workflow level in .github/workflows/ci.yml.

Job-specific non-secret variables were hoisted to their respective job
levels (test-build, impact-analysis), and redundant step-level
definitions were removed.

Sensitive secrets (GH_TOKEN, GEMINI_API_KEY, GITHUB_TOKEN,
LHCI_GITHUB_TOKEN) are maintained at the step level to ensure robust
propagation in containerized jobs and adhere to the principle of least
privilege.

Cleaned up redundant job-level env blocks in lint-typecheck and audit
jobs for better maintainability.
- Centralized gating logic into `.github/workflows/reusable-gate.yml`.
- Refactored `ci.yml`, `deploy.yml`, and `codeql.yml` to utilize the reusable gate.
- Re-architected `block-empty-jules-patches.yml` to utilize the centralized gate logic for PR closure.
- Leaner implementation of `verify-changes` logic to minimize overhead.
- Secured shell scripts by utilizing environment variables for GitHub context data.
- Maintained `actions/checkout@v6` as per explicit repository requirement.
- Consolidated security and merge-conflict checks into the main gated pipeline.
- Validated the complete workflow suite with `actionlint`.
…-6183521699809323700' into arii/workingbranch
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployment Details (Last updated: Jun 19, 2026, 4:49 PM PST)

🚀 Pushed to gh-pages; publish in progress

@github-actions

Copy link
Copy Markdown
Contributor

🐙 GitHub Models Code Review

Powered by GitHub Models

Reviewing: PR #2659

Model: gpt-4.1

Code Review Feedback

Review of Diff: CI Workflow Consolidation

HIGH Severity Review

1. .github/workflows/ci.yml — Job Dependency and Output Handling

Evidence:

  • The new verify-changes job is introduced as a foundational gate, and downstream jobs (e.g., lint-typecheck, audit, test-build, impact-analysis) now depend on it and use if: needs.verify-changes.outputs.has_changes == 'true'.
  • The reusable workflow .github/workflows/reusable-gate.yml defines an output has_changes for the job verify-changes, but the workflow-level output is defined as:
    workflow_call:
      outputs:
        has_changes:
          description: "True if changes were detected"
          value: ${{ jobs.verify-changes.outputs.has_changes }}
  • However, in the calling workflow (e.g., ci.yml), jobs reference needs.verify-changes.outputs.has_changes.

Blocking Issue:

  • GitHub Actions does NOT propagate outputs from reusable workflows to the calling workflow's needs context unless the reusable workflow is called via workflow_call and the output is explicitly mapped.
  • In the diff, the output is mapped, but the calling workflow jobs reference needs.verify-changes.outputs.has_changes. This is only valid if the reusable workflow is called via uses: ./.github/workflows/reusable-gate.yml and the output is mapped as shown.
  • However, in the calling workflow, the job name is also verify-changes, which can cause confusion and output propagation issues.
  • If the output is not correctly propagated, all downstream jobs will always evaluate needs.verify-changes.outputs.has_changes as empty or undefined, causing jobs to be skipped or run incorrectly.

Concrete Contradiction:

  • The output mapping in the reusable workflow is correct, but the calling workflow jobs reference needs.verify-changes.outputs.has_changes as if it is available in the needs context. If the output is not correctly propagated, this will break the workflow logic.

How to Fix:

  • Ensure that the output from the reusable workflow is correctly mapped and available in the calling workflow's needs context.
  • If the job name in the calling workflow is also verify-changes, it can shadow the reusable workflow's output, causing confusion.
  • Best practice: Use a different job name in the calling workflow (e.g., changes-gate) and reference the output as needs.changes-gate.outputs.has_changes.

2. .github/workflows/codeql.yml — Schedule Event Logic

Evidence:

  • The analyze job uses:
    if: needs.verify-changes.outputs.has_changes == 'true' || github.event_name == 'schedule'
  • The verify-changes job is only triggered via workflow_call, not on schedule.

Blocking Issue:

  • On scheduled runs (github.event_name == 'schedule'), the verify-changes job will NOT run, so needs.verify-changes.outputs.has_changes will be undefined.
  • This can cause the analyze job to fail due to missing dependency or undefined output.

How to Fix:

  • Add a conditional to only require verify-changes for non-scheduled events, or ensure verify-changes runs on schedule as well.

3. Deletion of Security and Conflict Check Workflows

Evidence:

  • .github/workflows/security.yml and .github/workflows/conflict-check.yml are deleted.
  • No evidence in the diff that their functionality is replaced elsewhere.

Blocking Issue:

  • If these workflows provided essential security scanning or merge conflict detection, their removal without replacement is a regression.
  • However, per review scope, unless the diff introduces a new untrusted input path or a regression in the stated goal, this is not blocking unless it breaks CI.

Verdict: Not blocking for this PR's stated goal, but should be tracked.


Summary

Blocking Issues:

  • Output propagation from reusable workflow to calling workflow jobs is ambiguous and likely broken, causing downstream jobs to be skipped or run incorrectly.
  • Scheduled events in codeql.yml will not have the required output, causing job failures.

JSON Findings

{ "findings": [ { "id": "finding-1", "file": ".github/workflows/ci.yml", "line": 41, "snippet": "needs: verify-changes\nif: needs.verify-changes.outputs.has_changes == 'true'", "issue": "Downstream jobs reference outputs from reusable workflow job 'verify-changes', but output propagation is ambiguous and likely broken. This will cause jobs to be skipped or run incorrectly.", "status": "unresolved", "fixSummary": "Ensure output from reusable workflow is correctly mapped and available in the calling workflow's needs context. Use distinct job names and reference outputs accordingly." }, { "id": "finding-2", "file": ".github/workflows/codeql.yml", "line": 29, "snippet": "if: needs.verify-changes.outputs.has_changes == 'true' || github.event_name == 'schedule'", "issue": "On scheduled runs, 'verify-changes' job does not run, so output is undefined. This can cause job failures.", "status": "unresolved", "fixSummary": "Ensure 'verify-changes' runs on schedule or adjust job dependencies and conditionals to avoid undefined outputs." } ] }

[VERDICT: FAIL]


Generated by github-models-code-review

@arii arii merged commit 9d61d0d into main Jun 20, 2026
13 of 14 checks passed
@arii arii deleted the arii/workingbranch branch June 20, 2026 00:37
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.

2 participants