Skip to content

chore: Improve rebase AI skill#763

Draft
RomanNikitenko wants to merge 17 commits into
che-incubator:mainfrom
RomanNikitenko:improve-rebase-skills
Draft

chore: Improve rebase AI skill#763
RomanNikitenko wants to merge 17 commits into
che-incubator:mainfrom
RomanNikitenko:improve-rebase-skills

Conversation

@RomanNikitenko

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Document real-world failure modes and recovery steps in the rebase skill (superseded CVE fixes, accidental rebase changes, stale elif entries, EOVERRIDE, silent exits, dirty merge state)
  • Harden the workflow: mandatory Node.js version switch before rebase.sh, post-fix re-validation, faster compile verification (compile-build-without-mangling), Dockerfile image updates when Node major bumps
  • Tighten Phase 4 PR creation: re-read directive, verification checklist, clearer commit formatting rules

Changes:

  • Superseded CVE fixes — revert Che-specific PRs when upstream already includes the fix (e.g. DOMPurify)
  • Accidental rebase changes — identify and restore upstream for changes with no PR/rule
  • Stale elif detection — pre-rebase integrity checks for orphaned routing in rebase.sh
  • Post-fix re-validation — re-check rules before proceeding to rebase.sh
  • Pre-flight clean state — abort leftover merges before re-running rebase.sh
  • EOVERRIDE / silent exits — clearer handling and debugging (bash -x)
  • Node.js version — switch to .nvmrc before any npm/rebase.sh work
  • Build verification — use non-mangled compile (~2–3 min) instead of full mangled build
  • Dockerfile images — Step 16 for aligning base images with the required Node major
  • PR body quality — mandatory re-read + checklist so agents don’t draft from stale context

What issues does this PR fix?

How to test this PR?

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d121b201-a97d-4628-84c7-3f5d9a79c1df

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@tolusha

tolusha commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant help — Show this help message

@tolusha

tolusha commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

⚠️ Warning: IDE/tool configuration files detected

This PR contains changes to files in directories that are typically not intended to be committed:

  • .claude/skills/rebase/SKILL.md

Please verify these changes are intentional.

RomanNikitenko and others added 17 commits July 23, 2026 21:40
Document the pattern for handling CVE fixes that upstream has already
incorporated: revert the che-specific PR instead of creating rebase rules.
Includes real example from DOMPurify 3.4.2 → upstream 3.4.8 (PR che-incubator#705).

Also documents the automation gap in pre-rebase.sh: it doesn't compare
against the TARGET upstream to detect superseded changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Document how to identify and handle changes that were introduced
accidentally during previous rebases (no PR, no rule). These can be
safely restored to upstream version. Example: authenticationService.ts
try/catch added during 1.108 rebase without a PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Add "Pre-rebase integrity checks" section covering orphaned elif
entries left behind when Che changes are reverted but the routing
in rebase.sh is not cleaned up. Includes detection steps and
automation opportunity.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
After fixing stale rules, the skill now explicitly requires:
1. Re-validate all from values against new upstream (fast sanity check)
2. Verify elif integrity (no orphan entries)
3. Optionally run full test suite

This prevents proceeding to rebase.sh with broken rules that
were missed or accidentally introduced during the fix phase.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Document the common failure mode where a previous failed rebase.sh
run leaves a merge in progress, causing subsequent runs to fail
with "working tree has modifications. Cannot add." Include the
recovery steps (git merge --abort) and the clean-state check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
- Split EOVERRIDE into two scenarios: upstream-surpassed (remove
  override) vs our-pin-higher (add to override/)
- Add new section (e) for silent exits caused by set -e and deleted
  files, with bash -x debugging tip
- Note that dependency audit should catch EOVERRIDE before rebase

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Upstream may bump the required Node.js major version between releases
(e.g. v22 → v24). The preinstall.ts script enforces .nvmrc and
npm install fails immediately with the wrong version. Document the
check-and-switch step before attempting the build.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Reworded from "check and install if different" to "always switch
before any npm commands" — clearer instruction for automation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
The full mangled build takes ~40 min and can fail on upstream mixin
patterns unrelated to Che changes. The non-mangled compilation
(~2-3 min) is sufficient to verify rebase correctness. The mangled
production build is handled separately in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
After build verification with the new Node.js version, lock files may
be regenerated (due to lockfileVersion or dependency tree changes).
Document this as a sub-step of Step 12 with detection and commit instructions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
rebase.sh runs npm install internally to regenerate lock files.
Using the correct Node.js/npm version from the start ensures lock
files are generated in the right format (e.g. npm 11 for Node 24)
and no separate "regenerate locks" commit is needed after build
verification.

Removes the "Lock file regeneration after Node.js version switch"
section from Step 12 as it becomes unnecessary with this approach.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Prevents agents from composing PR body from memory after long sessions
with many context switches. Adds:
- Bold directive at Phase 4 start to re-read the section before executing
- Post-creation verification checklist to catch deviations from template

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
When a step has multiple commits, list each as a sub-item with
commit message and short hash (instead of comma-separated hashes).
Additional non-standard steps are added as separate checklist items
in chronological order.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Documents the process for finding and updating Node.js base images
in Dockerfiles during rebase:
- How to determine required Node.js major version from .nvmrc
- How to use skopeo to find latest image tags from Red Hat catalog
  and Docker Hub
- Which 5 Dockerfiles need updating and their image patterns
- Additional checks (comments, npm global install, CXXFLAGS)
- Corresponding entry added to PR body template

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Relative paths like [Pre-rebase-report](.rebase/1.128/...) resolve
against the base branch (main) on GitHub, not the PR branch. Since
these report files only exist on the alignment branch, the links
break. Switch to absolute URLs with the branch name placeholder.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Document forbidden patterns (grep -P, declare -A, readarray) that
cause silent failures on macOS bash 3.2 / zsh, leading to incorrect
analysis results. Include verification discipline guidelines.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@RomanNikitenko
RomanNikitenko force-pushed the improve-rebase-skills branch from 6a141a4 to d514a34 Compare July 23, 2026 18:41
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