Skip to content

fix(mcb): stabilize from clean origin/main with conflict marker CI check - #218

Open
marlon-costa-dc wants to merge 1 commit into
mainfrom
fix/mcb-stabilization
Open

fix(mcb): stabilize from clean origin/main with conflict marker CI check#218
marlon-costa-dc wants to merge 1 commit into
mainfrom
fix/mcb-stabilization

Conversation

@marlon-costa-dc

@marlon-costa-dc marlon-costa-dc commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Stabiliza mcb a partir de origin/main clean.

Análise:


Summary by cubic

Adds a CI workflow that fails pull requests targeting main when tracked files contain merge conflict markers, preventing accidental merges of unresolved conflicts.

  • Skips vendored and build directories (.venv/, target/, dist/, .cache/, _vendor/) to avoid false positives.

Written for commit daeaff2. Summary will update on new commits.

Review in cubic

**Análise:**
- Repo no branch main (default)
- Broken merge PR #202 (69832e7) já revertido por c86edc2 no main
- 7 revert commits no histórico (reverts de código individual)
- Nenhum conflict marker no main
- CI: 8 workflows (7 existentes + 1 nova: conflict-marker-check)
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b4f9a003-7165-46b6-bff6-3b6d2e03254c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

3 issues found across 1 file

Confidence score: 2/5

  • In .github/workflows/conflict-marker-check.yml, =======$ matches ordinary lines ending in seven or more = characters, so the check can fail clean branches and block CI; restrict the pattern to actual conflict separators.
  • The same workflow splits tracked filenames containing whitespace into separate git grep arguments, while 2>/dev/null || true can conceal failures and missed markers; pass paths without shell splitting and avoid masking grep errors.
  • actions/checkout@v4 is mutable while existing workflows use immutable action SHAs, leaving this workflow exposed to unexpected upstream changes; pin checkout to the repository-approved commit.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/conflict-marker-check.yml">

<violation number="1" location=".github/workflows/conflict-marker-check.yml:11">
P2: `actions/checkout@v4` is mutable, unlike the SHA-pinned actions in the existing workflows. Pin this step to the repository’s approved immutable checkout commit.</violation>

<violation number="2" location=".github/workflows/conflict-marker-check.yml:16">
P1: The grep pattern `=======$` matches any line that ends with 7 or more `=` characters, not just conflict separators. On this repo's clean `main` (which per the PR title has no conflict markers), the command flags 75 files — including every `# ====...` comment banner in Cargo.toml, .env.example, .github/setup-ci.sh, .pr_agent.toml, and the workspace crates — so `exit 1` fires and this job fails on every PR. Anchor the pattern at line start and match the full marker set `^(<<<<<<<|=======|>>>>>>>)` (conflict markers always start at column 0). This also restores detection of `>>>>>>>` and `<<<<<<< branchname` markers that the current literal `<<<<<<< HEAD` alternative misses. Note the repo already has this exact correct pattern in scripts/lib/mcb.sh:121.</violation>

<violation number="3" location=".github/workflows/conflict-marker-check.yml:17">
P2: A tracked filename containing whitespace is split into multiple `git grep` arguments, and the redirected error plus `|| true` can hide markers in that file. Pass paths without shell splitting.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

submodules: true
- name: Check for merge conflict markers
run: |
markers=$(git grep -l '<<<<<<< HEAD\|=======$' -- \

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.

P1: The grep pattern =======$ matches any line that ends with 7 or more = characters, not just conflict separators. On this repo's clean main (which per the PR title has no conflict markers), the command flags 75 files — including every # ====... comment banner in Cargo.toml, .env.example, .github/setup-ci.sh, .pr_agent.toml, and the workspace crates — so exit 1 fires and this job fails on every PR. Anchor the pattern at line start and match the full marker set ^(<<<<<<<|=======|>>>>>>>) (conflict markers always start at column 0). This also restores detection of >>>>>>> and <<<<<<< branchname markers that the current literal <<<<<<< HEAD alternative misses. Note the repo already has this exact correct pattern in scripts/lib/mcb.sh:121.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/conflict-marker-check.yml, line 16:

<comment>The grep pattern `=======$` matches any line that ends with 7 or more `=` characters, not just conflict separators. On this repo's clean `main` (which per the PR title has no conflict markers), the command flags 75 files — including every `# ====...` comment banner in Cargo.toml, .env.example, .github/setup-ci.sh, .pr_agent.toml, and the workspace crates — so `exit 1` fires and this job fails on every PR. Anchor the pattern at line start and match the full marker set `^(<<<<<<<|=======|>>>>>>>)` (conflict markers always start at column 0). This also restores detection of `>>>>>>>` and `<<<<<<< branchname` markers that the current literal `<<<<<<< HEAD` alternative misses. Note the repo already has this exact correct pattern in scripts/lib/mcb.sh:121.</comment>

<file context>
@@ -0,0 +1,23 @@
+          submodules: true
+      - name: Check for merge conflict markers
+        run: |
+          markers=$(git grep -l '<<<<<<< HEAD\|=======$' -- \
+            $(git ls-files | grep -vE '\.venv/|target/|dist/|\.cache/|_vendor/' | tr '\n' ' ') 2>/dev/null || true)
+          if [ -n "$markers" ]; then
</file context>

- name: Check for merge conflict markers
run: |
markers=$(git grep -l '<<<<<<< HEAD\|=======$' -- \
$(git ls-files | grep -vE '\.venv/|target/|dist/|\.cache/|_vendor/' | tr '\n' ' ') 2>/dev/null || true)

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.

P2: A tracked filename containing whitespace is split into multiple git grep arguments, and the redirected error plus || true can hide markers in that file. Pass paths without shell splitting.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/conflict-marker-check.yml, line 17:

<comment>A tracked filename containing whitespace is split into multiple `git grep` arguments, and the redirected error plus `|| true` can hide markers in that file. Pass paths without shell splitting.</comment>

<file context>
@@ -0,0 +1,23 @@
+      - name: Check for merge conflict markers
+        run: |
+          markers=$(git grep -l '<<<<<<< HEAD\|=======$' -- \
+            $(git ls-files | grep -vE '\.venv/|target/|dist/|\.cache/|_vendor/' | tr '\n' ' ') 2>/dev/null || true)
+          if [ -n "$markers" ]; then
+            echo "::error::Merge conflict markers found in tracked files:"
</file context>

conflict-markers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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.

P2: actions/checkout@v4 is mutable, unlike the SHA-pinned actions in the existing workflows. Pin this step to the repository’s approved immutable checkout commit.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/conflict-marker-check.yml, line 11:

<comment>`actions/checkout@v4` is mutable, unlike the SHA-pinned actions in the existing workflows. Pin this step to the repository’s approved immutable checkout commit.</comment>

<file context>
@@ -0,0 +1,23 @@
+  conflict-markers:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          submodules: true
</file context>

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.

1 participant