Skip to content

feat(ci): automate branch protection for release branches (LE-880)#12939

Open
vjgit96 wants to merge 1 commit intomainfrom
feat/LE-880-auto-branch-protection-rules
Open

feat(ci): automate branch protection for release branches (LE-880)#12939
vjgit96 wants to merge 1 commit intomainfrom
feat/LE-880-auto-branch-protection-rules

Conversation

@vjgit96
Copy link
Copy Markdown
Collaborator

@vjgit96 vjgit96 commented Apr 29, 2026

Summary

Implements automated branch protection rule setup for release branches to address GitHub's limitation where wildcard patterns (release-*) don't work with merge queues enabled.

Changes

  • ✅ Added GitHub Action workflow that triggers on release-* branch creation
  • ✅ Automatically applies standardized branch protection rules via GitHub API
  • ✅ Includes comprehensive documentation with troubleshooting guide

How It Works

  1. Developer creates a release branch (e.g., release-1.11.0)
  2. Workflow automatically triggers within seconds
  3. Branch protection rules are applied programmatically
  4. Summary posted to workflow run for verification

Branch Protection Rules Applied

  • Required status checks (unit tests, integration tests, linting, type checking)
  • 2 required PR approvals with code owner reviews
  • Dismiss stale reviews and require last push approval
  • Conversation resolution required
  • Force pushes and branch deletion blocked
  • Merge queue (if supported by repository)

Testing

  • ✅ YAML syntax validated
  • ⚠️ Requires actual release branch creation to test end-to-end
  • Recommend testing with release-test-1.0.0 branch before production use

Documentation

See .github/workflows/RELEASE_BRANCH_PROTECTION.md for complete documentation, troubleshooting, and maintenance instructions.

Related

Summary by CodeRabbit

  • Chores

    • Automated branch protection setup for release branches, enforcing required CI/Lint/TypeCheck status checks, mandatory pull request reviews with code owner approval, and merge queue enforcement.
  • Documentation

    • Added comprehensive documentation for the release branch protection workflow, including setup instructions, configuration details, troubleshooting guidance, and security considerations.

- Add GitHub Action workflow to auto-detect release branch creation
- Automatically apply standardized branch protection rules
- Configure required status checks, PR reviews, and merge restrictions
- Include comprehensive documentation for setup and troubleshooting
- Implements workaround for wildcard pattern limitation with merge queues

Resolves: LE-880
@vjgit96 vjgit96 requested review from Adam-Aghili and erichare April 29, 2026 21:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

Walkthrough

Two new files establish automated branch protection for release branches. A documentation file describes the GitHub Actions workflow that applies branch protection rules to branches matching release-*, including required status checks, review requirements, merge queue configuration, and troubleshooting guidance. A corresponding GitHub Actions workflow implements the automated setup via GitHub REST API calls.

Changes

Cohort / File(s) Summary
Release Branch Protection Setup
.github/workflows/setup-release-branch-protection.yml, .github/workflows/RELEASE_BRANCH_PROTECTION.md
New GitHub Actions workflow and documentation for automated branch protection on release-* branches. Workflow extracts branch name, applies required CI/Lint/TypeCheck status checks, enforces PR reviews with code owner approval, disables force pushes/deletions, requires conversation resolution, and optionally enables merge queue. Includes error handling, nested try/catch for optional features, and step summary reporting. Documentation provides setup guidance, verification steps, troubleshooting scenarios, and security considerations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: automating branch protection for release branches via a new GitHub Actions workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Test Coverage For New Implementations ✅ Passed PR adds GitHub Actions workflow configuration and documentation, not application code. Repository has 39 existing workflow files with no unit tests, establishing that workflows are tested through manual execution and integration testing, not unit tests.
Test Quality And Coverage ✅ Passed PR adds GitHub Actions workflow configuration and documentation, not application code requiring traditional unit tests.
Test File Naming And Structure ✅ Passed PR contains only GitHub Actions workflow configuration files with no test files present, so test file naming and structure verification is not applicable.
Excessive Mock Usage Warning ✅ Passed This custom check requires reviewing test files for excessive mock usage and test design patterns. The pull request only adds GitHub Actions workflow configuration files and documentation. Since no test files are being modified or added in this PR, the check is not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/LE-880-auto-branch-protection-rules

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@vjgit96 vjgit96 requested a review from jordanrfrazier April 29, 2026 21:21
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.93%. Comparing base (7640ce6) to head (b60dedc).

❌ Your project check has failed because the head coverage (49.99%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12939      +/-   ##
==========================================
+ Coverage   52.92%   52.93%   +0.01%     
==========================================
  Files        2030     2030              
  Lines      183826   183826              
  Branches    27680    26202    -1478     
==========================================
+ Hits        97286    97309      +23     
+ Misses      85440    85418      -22     
+ Partials     1100     1099       -1     
Flag Coverage Δ
backend 56.15% <ø> (-0.01%) ⬇️
frontend 52.88% <ø> (+0.01%) ⬆️
lfx 49.99% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/setup-release-branch-protection.yml:
- Around line 122-138: The Post summary step currently always writes success
checkmarks because it runs with if: always(); change it so the step still runs
unconditionally but inspects the prior branch protection step's outcome (e.g.,
steps.apply_branch_protection.outcome or
steps.apply_branch_protection.conclusion) and emits either the success list or a
failure summary with clear error indicators; use the existing reference
steps.extract_branch.outputs.branch_name for the branch display and replace the
static checkmarks with conditional content based on that outcome so failures
produce a warning/error message instead of green checkmarks.
- Around line 3-6: The workflow uses an unsupported branches filter on the
create event: remove the branches key under the on.create block and keep just
"on: create"; then add a job-level guard to run only for release branches (e.g.
use an if conditional referencing github.ref or github.event.ref and
startsWith('refs/heads/release-') within the job) so the workflow only acts on
release-* branch creations; update any job names that expect this filter (job
identifiers) to include that if check.
- Around line 8-10: The workflow uses an invalid permissions key
"administration" and attempts to perform branch-protection updates with
GITHUB_TOKEN (see the permissions block and the updateBranchProtection API
calls), which will fail because GITHUB_TOKEN can't be elevated to repo admin;
replace the invalid key by removing "administration" from the permissions block
and change the workflow to read admin credentials from a new secret (e.g.
RELEASE_BRANCH_PROTECTION_TOKEN) that contains a GitHub App installation token
or PAT with repo admin rights, then use that token instead of GITHUB_TOKEN when
calling updateBranchProtection (and ensure the secret is added to the repository
secrets).
- Around line 43-51: The required_status_checks block currently lists contexts
like 'CI / Run Integration Tests' and 'CI / Lint Frontend' that are
path-filtered and can remain Pending when their workflows don't trigger; update
the branch protection config so only always-running checks are required or
change those workflows so they always run but perform path gating at the job
level (e.g., move path filters out of the workflow trigger into per-job
conditional execution while keeping the workflow triggered for every push/PR),
and remove or replace any path-filtered contexts from the contexts array (e.g.,
'CI / Run Integration Tests', 'CI / Lint Frontend') so branch protection never
depends on checks that can be skipped.
- Around line 72-110: The required_status_checks.contexts in the
updateBranchProtection call (see updateBranchProtection and
required_status_checks.contexts for branchName and merge_queue configuration)
list hardcoded check names that don't match the actual CI job names, causing
checks to never report as complete; update the contexts array in both branch
protection blocks to use the exact job names defined in .github/workflows/ci.yml
(e.g., "Run Backend Tests", "Run Frontend Unit Tests", "Run Frontend Tests",
etc.) or implement a mapping that translates the intended human-readable names
to those workflow job names so the merge_queue can correctly detect completed
checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c139b8a9-7ba5-40d7-bd38-fe484ed9fb22

📥 Commits

Reviewing files that changed from the base of the PR and between 7640ce6 and b60dedc.

📒 Files selected for processing (2)
  • .github/workflows/RELEASE_BRANCH_PROTECTION.md
  • .github/workflows/setup-release-branch-protection.yml

Comment on lines +3 to +6
on:
create:
branches:
- 'release-*'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

GitHub Actions create event branches filter syntax documentation

💡 Result:

GitHub Actions does not support branch name filtering (branches / branches-ignore) on the workflow-level create event. So this syntax won’t work as an event filter: on: create: branches: - 'feature/' What to do instead 1) Use push with a branches filter, then gate “first-time branch creation” inside the workflow. - The create event runs when someone creates a Git reference (branch or tag). - But branch filtering is described for other triggers like push/pull_request, and the create trigger does not document/offer a branches filter. 2) Use an expression/condition to skip runs when the created ref doesn’t match your desired pattern. - The GitHub community guidance/workarounds recommend using an if condition based on github.ref (example uses contains(github.ref, 'refs/heads/releases/')). Example (skip at job level): on: create jobs: pr: if: ${{ startsWith(github.ref, 'refs/heads/feature/') }} runs-on: ubuntu-latest steps: - run: echo "Only runs for feature/*" Example (push-based approach): on: push: branches: - 'feature/' jobs: pr: # github.event.created is used as a signal for branch creation vs later pushes if: ${{ github.event.created && startsWith(github.ref, 'refs/heads/feature/') }} runs-on: ubuntu-latest steps: - run: echo "Runs on first creation (when created is true)" If you want the workflow not to even start, you can’t achieve that with a create-event branches filter; the filtering requires conditions (or switching to push + checking github.event.created).

Citations:


🌐 Web query:

GitHub Actions workflow create event trigger reference

💡 Result:

The create event in GitHub Actions triggers a workflow when a Git branch or tag is created in the repository. It corresponds to the CreateEvent webhook. ### Trigger Configuration Use the on: create key in your workflow YAML: on: create No activity types are supported. Note: No event is created if more than three tags are created at once. GITHUB_SHA is the last commit on the created branch/tag. GITHUB_REF is the created branch or tag ref. ### Event Context Reference (github.event) The github.event object matches the CreateEvent webhook payload: | Property | Type | Description | |----------------|---------------|-------------| | ref | string | Git ref (branch name or tag name; null if ref_type is 'repository') | | ref_type | string | Type: 'branch', 'tag', or 'repository' | | master_branch | string | Repository's default branch (usually 'main') | | description | string/null | Repository's current description | | pusher_type | string | 'user' or deploy key | | full_ref | string | Fully-formed ref (e.g., 'refs/heads/branch-name') | Access via expressions like ${{ github.event.ref_type }} or ${{ github.event.ref }}. github.event_name is 'create'. For full webhook details, see GitHub's event types documentation. To inspect payloads, add a step: env: GITHUB_CONTEXT: ${{ toJSON(github) }}; run: echo "$GITHUB_CONTEXT". Official sources: GitHub Docs (Events that trigger workflows, Contexts reference, Webhook events and payloads, GitHub event types).

Citations:


Remove the unsupported branches filter from create.

GitHub's create event does not accept branches filtering, so this workflow will not validate as written. The branches filter is only supported on events like push and pull_request. Use on: create unfiltered and apply a job-level condition if you need to differentiate release-branch creation.

Suggested fix
 on:
-  create:
-    branches:
-      - 'release-*'
+  create:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
create:
branches:
- 'release-*'
on:
create:
🧰 Tools
🪛 actionlint (1.7.12)

[error] 5-5: "branches" filter is not available for create event. it is only for merge_group, push, pull_request, pull_request_target, workflow_run events

(events)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/setup-release-branch-protection.yml around lines 3 - 6,
The workflow uses an unsupported branches filter on the create event: remove the
branches key under the on.create block and keep just "on: create"; then add a
job-level guard to run only for release branches (e.g. use an if conditional
referencing github.ref or github.event.ref and startsWith('refs/heads/release-')
within the job) so the workflow only acts on release-* branch creations; update
any job names that expect this filter (job identifiers) to include that if
check.

Comment on lines +8 to +10
permissions:
contents: read
administration: write
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/setup-release-branch-protection.yml

Repository: langflow-ai/langflow

Length of output: 6615


🌐 Web query:

GitHub Actions workflow permissions valid keys documentation

💡 Result:

The valid keys for GitHub Actions workflow permissions are the scopes that control access for the GITHUB_TOKEN. These can be set at the workflow or job level using the 'permissions' key, with values 'read', 'write', or 'none' (write includes read). Unspecified permissions default to 'none'. Complete list of valid permission keys from official documentation: - actions: read|write|none - artifact-metadata: read|write|none - attestations: read|write|none - checks: read|write|none - contents: read|write|none - deployments: read|write|none - id-token: write|none - issues: read|write|none - models: read|none - discussions: read|write|none - packages: read|write|none - pages: read|write|none - pull-requests: read|write|none - security-events: read|write|none - statuses: read|write|none - vulnerability-alerts: read|none You can also use 'read-all' or 'write-all' for all permissions. Example usage: permissions: contents: read issues: write Official documentation: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

Citations:


🌐 Web query:

GitHub REST API updateBranchProtection permission requirements GITHUB_TOKEN

💡 Result:

To call the GitHub REST API to update branch protection (PUT /repos/{owner}/{repo}/branches/{branch}/protection), the authenticated actor must have admin or owner permissions to the repository. If you’re using GITHUB_TOKEN from GitHub Actions, that means the workflow’s token must be granted sufficient repository permissions via the workflow/job permissions settings; otherwise the API call will fail with an authorization error. GitHub documents that you can control the GITHUB_TOKEN’s permissions using the workflow file’s permissions key. Practical guidance (GitHub Actions): - Use a workflow/job permissions block to grant the needed GITHUB_TOKEN access. - If the needed permission isn’t available via GITHUB_TOKEN, GitHub’s docs recommend using a GitHub App installation token or a PAT instead. Endpoint: - PUT /repos/{owner}/{repo}/branches/{branch}/protection - Requirement stated by GitHub: “Protecting a branch requires admin or owner permissions to the repository.”

Citations:


administration is not a valid permissions key, and GITHUB_TOKEN cannot satisfy branch-protection admin requirements.

The administration key does not exist in GitHub Actions workflow permissions. Valid keys are: actions, checks, contents, deployments, id-token, issues, packages, pages, pull-requests, security-events, statuses, and others—but there is no permission key that grants admin-level access to GITHUB_TOKEN.

The updateBranchProtection API endpoint requires admin or owner repository permissions. Since GITHUB_TOKEN cannot be elevated to admin level through the permissions block, this workflow will fail at runtime when attempting the API call on lines 39 and 74.

Use an admin-capable token instead—either a GitHub App installation token or a Personal Access Token with admin privileges:

Required fix
 permissions:
   contents: read
-  administration: write

 ...
-          github-token: ${{ secrets.GITHUB_TOKEN }}
+          github-token: ${{ secrets.RELEASE_BRANCH_PROTECTION_TOKEN }}

Create RELEASE_BRANCH_PROTECTION_TOKEN as a repository secret containing a GitHub App or PAT with admin access.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 10-10: unknown permission scope "administration". all available permission scopes are "actions", "artifact-metadata", "attestations", "checks", "contents", "deployments", "discussions", "id-token", "issues", "models", "packages", "pages", "pull-requests", "repository-projects", "security-events", "statuses"

(permissions)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/setup-release-branch-protection.yml around lines 8 - 10,
The workflow uses an invalid permissions key "administration" and attempts to
perform branch-protection updates with GITHUB_TOKEN (see the permissions block
and the updateBranchProtection API calls), which will fail because GITHUB_TOKEN
can't be elevated to repo admin; replace the invalid key by removing
"administration" from the permissions block and change the workflow to read
admin credentials from a new secret (e.g. RELEASE_BRANCH_PROTECTION_TOKEN) that
contains a GitHub App installation token or PAT with repo admin rights, then use
that token instead of GITHUB_TOKEN when calling updateBranchProtection (and
ensure the secret is added to the repository secrets).

Comment on lines +43 to +51
required_status_checks: {
strict: true,
contexts: [
'CI / Run Unit Tests',
'CI / Run Integration Tests',
'CI / Lint Backend',
'CI / Lint Frontend',
'CI / Type Check'
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don't hard-require workflows that are path-filtered.

Some of the required checks (at least 'CI / Run Integration Tests' and 'CI / Lint Frontend') only run when their respective files change, as they're guarded by paths filters in their workflows. Per GitHub's documentation, skipped required checks remain in Pending status when their trigger conditions aren't met, which blocks merging. This means unrelated PRs (e.g., docs-only changes) can become unmergeable when these path-filtered checks don't run. Either require only checks that always run, or convert filtered workflows to always run but conditionally execute jobs (placing the path filter at the job level behind an always-reporting check).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/setup-release-branch-protection.yml around lines 43 - 51,
The required_status_checks block currently lists contexts like 'CI / Run
Integration Tests' and 'CI / Lint Frontend' that are path-filtered and can
remain Pending when their workflows don't trigger; update the branch protection
config so only always-running checks are required or change those workflows so
they always run but perform path gating at the job level (e.g., move path
filters out of the workflow trigger into per-job conditional execution while
keeping the workflow triggered for every push/PR), and remove or replace any
path-filtered contexts from the contexts array (e.g., 'CI / Run Integration
Tests', 'CI / Lint Frontend') so branch protection never depends on checks that
can be skipped.

Comment on lines +72 to +110
// Enable merge queue if available
try {
await github.rest.repos.updateBranchProtection({
owner,
repo,
branch: branchName,
required_status_checks: {
strict: true,
contexts: [
'CI / Run Unit Tests',
'CI / Run Integration Tests',
'CI / Lint Backend',
'CI / Lint Frontend',
'CI / Type Check'
]
},
enforce_admins: false,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
require_code_owner_reviews: true,
required_approving_review_count: 2,
require_last_push_approval: true
},
restrictions: null,
required_linear_history: false,
allow_force_pushes: false,
allow_deletions: false,
block_creations: false,
required_conversation_resolution: true,
lock_branch: false,
allow_fork_syncing: false,
// Merge queue configuration
merge_queue: {
enabled: true,
merge_method: 'squash',
check_response_timeout_minutes: 60,
grouping_strategy: 'ALLGREEN'
}
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find .github/workflows -type f -name "*.yml" -o -name "*.yaml" | head -20

Repository: langflow-ai/langflow

Length of output: 779


🏁 Script executed:

cat .github/workflows/setup-release-branch-protection.yml 2>/dev/null | head -150

Repository: langflow-ai/langflow

Length of output: 5635


🏁 Script executed:

# Find all workflow files
git ls-files .github/workflows/ | grep -E '\.(yml|yaml)$'

Repository: langflow-ai/langflow

Length of output: 1466


🏁 Script executed:

cat .github/workflows/ci.yml | head -100

Repository: langflow-ai/langflow

Length of output: 2879


🏁 Script executed:

# Search for merge_group in all workflows
rg "merge_group" .github/workflows/

Repository: langflow-ai/langflow

Length of output: 1420


🏁 Script executed:

# Check for the check names in ci.yml
rg "Run Unit Tests|Run Integration Tests|Lint Backend|Lint Frontend|Type Check" .github/workflows/ci.yml -A 5 -B 5

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

rg "name:" .github/workflows/ci.yml | grep -E "job|name:" | head -30

Repository: langflow-ai/langflow

Length of output: 1022


🏁 Script executed:

# Look for job definitions and their names
ast-grep --pattern 'jobs:
  $$$' .github/workflows/ci.yml 2>/dev/null || cat .github/workflows/ci.yml | grep -A 200 "^jobs:" | head -100

Repository: langflow-ai/langflow

Length of output: 30562


🏁 Script executed:

# Check other workflow files that might provide the required checks
cat .github/workflows/integration_tests.yml | head -80

Repository: langflow-ai/langflow

Length of output: 1598


🏁 Script executed:

# Search for the exact check names in all workflows
rg "CI / Run Unit Tests|CI / Run Integration Tests|CI / Lint Backend|CI / Lint Frontend|CI / Type Check" .github/workflows/

Repository: langflow-ai/langflow

Length of output: 1548


🏁 Script executed:

# Check the python_test.yml reusable workflow
cat .github/workflows/python_test.yml | head -80

Repository: langflow-ai/langflow

Length of output: 2491


🏁 Script executed:

# Check the jest_test.yml reusable workflow
cat .github/workflows/jest_test.yml | head -80

Repository: langflow-ai/langflow

Length of output: 2186


🏁 Script executed:

# Look for any workflow that might generate these specific check names
rg "Run Unit Tests|Run Integration Tests|Lint Backend|Lint Frontend|Type Check" .github/workflows/ --type yaml -B 3 -A 3

Repository: langflow-ai/langflow

Length of output: 2713


🏁 Script executed:

# Check if there are GitHub composite actions or other mechanisms generating these names
find .github -name "*.yml" -o -name "*.yaml" | xargs grep -l "outputs\|run:" | head -20

Repository: langflow-ai/langflow

Length of output: 766


🏁 Script executed:

# Look for any lint workflows
ls -la .github/workflows/ | grep -i lint

Repository: langflow-ai/langflow

Length of output: 188


🏁 Script executed:

# Check the lint-py and lint-js workflows
cat .github/workflows/lint-py.yml 2>/dev/null | head -60

Repository: langflow-ai/langflow

Length of output: 1122


🏁 Script executed:

cat .github/workflows/lint-js.yml

Repository: langflow-ai/langflow

Length of output: 1238


🏁 Script executed:

# Search for where "CI /" prefix is added to check names
rg "CI /" .github/workflows/ --type yaml

Repository: langflow-ai/langflow

Length of output: 1042


🏁 Script executed:

# Check if there's a documentation about the expected check names
cat .github/workflows/RELEASE_BRANCH_PROTECTION.md 2>/dev/null

Repository: langflow-ai/langflow

Length of output: 5071


🏁 Script executed:

# Verify what the actual check/job names are in ci.yml when it runs
# Look for where jobs generate their check names
cat .github/workflows/python_test.yml | grep -A 5 "name:"

Repository: langflow-ai/langflow

Length of output: 6202


🏁 Script executed:

# Check if ci.yml is calling these workflows with specific outputs
cat .github/workflows/ci.yml | grep -A 20 "uses: ./.github/workflows/"

Repository: langflow-ai/langflow

Length of output: 3476


🏁 Script executed:

# Check if lint-py.yml and lint-js.yml have merge_group trigger
cat .github/workflows/lint-py.yml | grep -E "^on:|merge_group|pull_request|workflow"

Repository: langflow-ai/langflow

Length of output: 106


🏁 Script executed:

cat .github/workflows/lint-js.yml | grep -E "^on:|merge_group|pull_request|workflow"

Repository: langflow-ai/langflow

Length of output: 106


🏁 Script executed:

# Also check typescript_test.yml which is used for frontend tests
cat .github/workflows/typescript_test.yml | head -50

Repository: langflow-ai/langflow

Length of output: 1288


🏁 Script executed:

# Search for any configuration that adds the "CI / " prefix to check names
rg "CI /" . --type yaml --type json 2>/dev/null | grep -v "setup-release-branch-protection" | grep -v "RELEASE_BRANCH_PROTECTION.md"

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Check if there's any action or script that maps job names to check names
find .github -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.js" -o -name "*.py" \) | xargs grep -l "check.*name\|status.*check" 2>/dev/null | head -10

Repository: langflow-ai/langflow

Length of output: 175


🏁 Script executed:

# Look at the ci.yml job definitions more carefully - check if there's a top-level job that aggregates/names these
cat .github/workflows/ci.yml | grep -A 5 "jobs:" | head -20

Repository: langflow-ai/langflow

Length of output: 392


🏁 Script executed:

# Let me check if ci.yml has any special naming for its top-level jobs
cat .github/workflows/ci.yml | grep -E "^\s+name:" | head -20

Repository: langflow-ai/langflow

Length of output: 461


🏁 Script executed:

# Check the structure - what are the actual job names that would be reported as checks?
cat .github/workflows/ci.yml | grep -B 2 "name:" | grep -E "^\s+test-|^\s+ci_" | head -20

Repository: langflow-ai/langflow

Length of output: 166


🏁 Script executed:

# Let's see the full job structure with names
cat .github/workflows/ci.yml | grep -E "^  [a-z-]+:" | head -20

Repository: langflow-ai/langflow

Length of output: 349


The required status check names do not match the actual CI job names in the workflow.

The hardcoded required checks ('CI / Run Unit Tests', 'CI / Run Integration Tests', 'CI / Lint Backend', 'CI / Lint Frontend', 'CI / Type Check') will never complete because the actual CI workflow jobs are named differently ("Run Backend Tests", "Run Frontend Unit Tests", "Run Frontend Tests", etc.). When merge queue attempts to verify the required checks, they will never report as complete, causing PRs to stall in the queue.

Update the required_status_checks.contexts array in both branch protection configuration blocks to match the actual job names from .github/workflows/ci.yml, or ensure a mapping exists between the intended check names and the workflow job names.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/setup-release-branch-protection.yml around lines 72 - 110,
The required_status_checks.contexts in the updateBranchProtection call (see
updateBranchProtection and required_status_checks.contexts for branchName and
merge_queue configuration) list hardcoded check names that don't match the
actual CI job names, causing checks to never report as complete; update the
contexts array in both branch protection blocks to use the exact job names
defined in .github/workflows/ci.yml (e.g., "Run Backend Tests", "Run Frontend
Unit Tests", "Run Frontend Tests", etc.) or implement a mapping that translates
the intended human-readable names to those workflow job names so the merge_queue
can correctly detect completed checks.

Comment on lines +122 to +138
- name: Post summary
if: always()
run: |
echo "## Branch Protection Setup" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** \`${{ steps.extract_branch.outputs.branch_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Protection Rules Applied:" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Required status checks enabled" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Required pull request reviews (2 approvals)" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Code owner reviews required" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Dismiss stale reviews enabled" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Require last push approval" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Conversation resolution required" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Force pushes blocked" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Branch deletion blocked" >> $GITHUB_STEP_SUMMARY
echo "- ⚠️ Merge queue (if supported by repository)" >> $GITHUB_STEP_SUMMARY
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

The summary reports success even when setup fails.

Post summary runs under always() and always writes green checkmarks, even when the API step fails. That leaves a failed run with a success-looking summary for a repo-security control. Drive this section from the previous step outcome and emit a failure summary when setup does not complete.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/setup-release-branch-protection.yml around lines 122 -
138, The Post summary step currently always writes success checkmarks because it
runs with if: always(); change it so the step still runs unconditionally but
inspects the prior branch protection step's outcome (e.g.,
steps.apply_branch_protection.outcome or
steps.apply_branch_protection.conclusion) and emits either the success list or a
failure summary with clear error indicators; use the existing reference
steps.extract_branch.outputs.branch_name for the branch display and replace the
static checkmarks with conditional content based on that outcome so failures
produce a warning/error message instead of green checkmarks.

@github-actions
Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 35%
35.26% (40427/114627) 68.08% (5580/8196) 35.87% (940/2620)

Unit Test Results

Tests Skipped Failures Errors Time
4007 0 💤 0 ❌ 0 🔥 7m 34s ⏱️

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant