release-cherry-pick 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/package.json +4 -1
- package/.atl/.skill-registry.cache.json +0 -3
- package/.atl/skill-registry.md +0 -55
- package/.husky/pre-commit +0 -1
- package/CLAUDE.md +0 -74
- package/eslint.config.js +0 -34
- package/openspec/changes/archive/.gitkeep +0 -0
- package/openspec/changes/node-cli-release-cherry-pick/.openspec.yaml +0 -2
- package/openspec/changes/node-cli-release-cherry-pick/design.md +0 -126
- package/openspec/changes/node-cli-release-cherry-pick/proposal.md +0 -39
- package/openspec/changes/node-cli-release-cherry-pick/specs/branch-selection/spec.md +0 -42
- package/openspec/changes/node-cli-release-cherry-pick/specs/cherry-pick-orchestration/spec.md +0 -49
- package/openspec/changes/node-cli-release-cherry-pick/specs/cli-core/spec.md +0 -37
- package/openspec/changes/node-cli-release-cherry-pick/specs/config-management/spec.md +0 -52
- package/openspec/changes/node-cli-release-cherry-pick/specs/documentation-generation/spec.md +0 -38
- package/openspec/changes/node-cli-release-cherry-pick/specs/gitlab-integration/spec.md +0 -49
- package/openspec/changes/node-cli-release-cherry-pick/specs/release-summary/spec.md +0 -37
- package/openspec/changes/node-cli-release-cherry-pick/tasks.md +0 -70
- package/openspec/config.yaml +0 -32
- package/openspec/specs/.gitkeep +0 -0
- package/scripts/sandbox/harness.js +0 -130
- package/scripts/sandbox/make-sandbox.sh +0 -90
- package/scripts/sandbox/run-config.js +0 -26
- package/scripts/sandbox/run-release.js +0 -26
- package/scripts/sandbox/test-package.js +0 -571
- package/skills-lock.json +0 -11
- package/test-e2e.js +0 -56
package/README.md
CHANGED
|
@@ -39,9 +39,19 @@ Given a list of task IDs (from a file, a `-b` flag, or interactive branch select
|
|
|
39
39
|
## Installation
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npm install
|
|
42
|
+
npm install release-cherry-pick # local — run it with `npx release-cherry-pick`
|
|
43
|
+
npm install --global release-cherry-pick # global — `release-cherry-pick` on your PATH
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
Or with pnpm:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm add release-cherry-pick # local
|
|
50
|
+
pnpm add --global release-cherry-pick # global
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To work on the CLI itself, clone the repository and run `npm install`, then `npm run setup` to install the git hooks.
|
|
54
|
+
|
|
45
55
|
## Usage
|
|
46
56
|
|
|
47
57
|
### Run a release
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-cherry-pick",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "CLI tool for automating release cherry-pick and GitLab MR creation",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"src"
|
|
8
|
+
],
|
|
6
9
|
"bin": {
|
|
7
10
|
"release-cherry-pick": "./src/index.js"
|
|
8
11
|
},
|
package/.atl/skill-registry.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Skill Registry — release-cherry-pick
|
|
2
|
-
|
|
3
|
-
<!-- Auto-generated by gentle-ai skill-registry refresh. Run `gentle-ai skill-registry refresh --force` to regenerate. -->
|
|
4
|
-
|
|
5
|
-
Last updated: 2026-10-27
|
|
6
|
-
|
|
7
|
-
## Sources scanned
|
|
8
|
-
|
|
9
|
-
- /home/diovi/.agents/skills
|
|
10
|
-
- /home/diovi/.config/opencode/skills
|
|
11
|
-
- /home/diovi/.claude/skills
|
|
12
|
-
|
|
13
|
-
## Contract
|
|
14
|
-
|
|
15
|
-
**Delegator use only.** This registry is an index, not a summary. Any agent that launches subagents reads it to select relevant skills, then passes exact `SKILL.md` paths for the subagent to read before work.
|
|
16
|
-
|
|
17
|
-
`SKILL.md` remains the source of truth. Do not inject generated summaries or compact rules by default; pass paths so subagents load the full runtime contract and preserve author intent.
|
|
18
|
-
|
|
19
|
-
## Skills
|
|
20
|
-
|
|
21
|
-
| Skill | Trigger / description | Scope | Path |
|
|
22
|
-
| --- | --- | --- | --- |
|
|
23
|
-
| `adr` | Ingenius Software's Architecture Decision Record (ADR) format -- 22 fields covering context, decision, alternatives, consequences, and impact on principles/security/cost, with usage guidance for the fields that need it. Use when asked to record, write, or draft an ADR, when a significant architectural decision needs to be documented, or when reviewing whether an existing ADR is complete. Does not cover which architectural principle a decision affects (see architectural-principles, cited from this template's "Impact on principles" field) or whether the decision needs Architecture Review Board approval (see operating-model). arc42-template's own "Architectural decisions" section only lists and links ADRs; it doesn't define their format -- this plugin does. | user | `/home/diovi/.claude/skills/adr/SKILL.md` |
|
|
24
|
-
| `agentic-delivery` | Ingenius methodology for governing delivery work that AI agents (e.g. Claude Code) execute and people approve -- "the agent proposes, arbiters dispose". Use for process questions about working with agents, not for doing the work -- setting a project up for AI-agent delivery (milestone zero), how much autonomy or how many retries an agent gets, what counts as an arbiter or as evidence agent work is done (golden vs. live-fire), phase gates F0-F7, the 7-stage unit loop, agent-per-role with a human approver, parallel agent sessions in batches/waves, logbooks and RESUME HERE, facts sheet, process audits. Not for ordinary tasks an agent performs (coding, adding endpoints, refactoring, writing tests, generating a backlog). Does not cover delivery steps per modality (delivery-playbook), roles/ARB (operating-model), DoD criteria (definition-of-done), adr, arc42-template, security-policy, responsible-ai, architectural-principles, per-modality-checklist, skill-authoring, or producing artifacts (sdlc-skills). | user | `/home/diovi/.claude/skills/agentic-delivery/SKILL.md` |
|
|
25
|
-
| `agentic-migration` | Úsalo al construir o migrar un sistema software con agentes de IA cuando quieras acotar su autonomía con verificación determinista: árbitros que el agente NO escribió (compilador, linter, pruebas con umbral de cobertura, build de producción, e2e, análisis estático) deciden cada cambio. Método reproducible de 7 etapas (analizar, orquestar, traducir, generar, aislar, verificar, registrar), agnóstico de stack: sirve para frontend, backend, sistemas completos o greenfield. Lee el fichero de references/ correspondiente al entrar en cada etapa. | user | `/home/diovi/.claude/skills/agentic-migration/SKILL.md` |
|
|
26
|
-
| `arc42-template` | Ingenius Software's adapted arc42 template for documenting a real project's architecture — 12 sections (full version) or a 7-section reduced version for small/on-demand work. Use when asked to create, start, or maintain the architecture documentation for an Ingenius project, when asked "what should our arc42 doc cover", or when reviewing whether a project's existing architecture documentation is complete. Does not cover which architectural principle applies to a decision (see architectural-principles), who should review or approve it (see operating-model), or the format of an individual decision record (see adr; this template's own "Architectural decisions" section only lists them). | user | `/home/diovi/.claude/skills/arc42-template/SKILL.md` |
|
|
27
|
-
| `architectural-principles` | Ingenius Software's foundational, technology-agnostic architecture principles — the 16 architectural principles (P01-P16), the 4-tier governance model (Principles/Policies/Standards/Guides), and generic coding principles (DRY/KISS/SOLID/YAGNI/Clean Code). Use when citing which Ingenius principle a decision affects or violates, when an ADR or design discussion needs to reference "P0X", when asked "what's Ingenius's architectural philosophy/stance on X" (e.g. monoliths vs. microservices, security by design, reuse), or when reviewing whether a project or plugin aligns with these principles. Does not cover technology-specific coding standards (those live in each technology-specific marketplace, e.g. ingenius-dotnet-skills for .NET), the real technology radar/asset catalog (see tech-radar-catalog), or process/roles (see operating-model). | user | `/home/diovi/.claude/skills/architectural-principles/SKILL.md` |
|
|
28
|
-
| `chained-pr` | Trigger: PRs over 400 lines, stacked PRs, review slices. Split oversized changes into chained PRs that protect review focus. | user | `/home/diovi/.agents/skills/chained-pr/SKILL.md` |
|
|
29
|
-
| `clean-architecture-conformance` | Audits an ASP.NET Core project that follows Clean Architecture — either as a Modular Monolith by Bounded Context (generated by clean-architecture-scaffold/clean-architecture-feature or equivalent) or as classic flat layered Clean Architecture (one Domain/Application/Infrastructure/Api project per solution, no Bounded Contexts) — against the Dependency Rule, module isolation (when applicable), and SOLID/Clean Code violations specific to this architecture. Use when asked to "audit the architecture", "check that the Dependency Rule wasn't broken", "verify module isolation", "does this code respect Clean Architecture?", before a pre-production review, or periodically as architectural health check. Do NOT use for a general code quality review (bugs, style, simplification) unrelated to the layered architecture — use /code-review or /simplify for that. Do NOT use to create a project (clean-architecture-scaffold) or to add a feature (clean-architecture-feature). Reports findings by default; fixes nothing unless the user explicitly asks. | user | `/home/diovi/.config/opencode/skills/clean-architecture-conformance/SKILL.md` |
|
|
30
|
-
| `clean-architecture-feature` | Adds a new use case, entity, or complete feature to an ASP.NET Core project that already follows Clean Architecture as a Modular Monolith by Bounded Context (generated by clean-architecture-scaffold or equivalent). Use when asked to "add a use case", "I need a new entity", "add an endpoint for X", "add a new module" on a project that ALREADY EXISTS. Reads the project's real code (SharedKernel, an already-existing aggregate) to replicate its exact convention — it does not impose its own template nor assume the project uses a third-party MediatR/Result if the real project uses something different. Can create a new Bounded Context (module) if the feature's target doesn't exist yet. DO NOT use to create a project from scratch (use clean-architecture-scaffold), nor to audit conformance of existing code against layer rules (use clean-architecture-conformance), nor on a project that doesn't follow this architecture (layered Clean Architecture with Result pattern) — there is no real convention to read and replicate there. | user | `/home/diovi/.config/opencode/skills/clean-architecture-feature/SKILL.md` |
|
|
31
|
-
| `clean-architecture-scaffold` | Creates a new ASP.NET Core Web API project applying Clean Architecture as a Modular Monolith (Bounded Contexts as internal modules, each with Domain/Application/Infrastructure) from scratch, following Ingenius Software's coding and architecture standards. Use when asked to "create a new project", "build a Web API with Clean Architecture", "scaffold a .NET solution" or equivalent, and the project does not exist yet. Requires the Bounded Contexts to already be identified/designed beforehand (this skill does not perform DDD discovery). Generates simple use cases without MediatR, a custom Result pattern for business errors, EF Core (PostgreSQL or SQL Server, by choice), and test projects with xUnit+NSubstitute+Testcontainers. Do NOT use it to add a use case to a project that already has this structure (use clean-architecture-feature), to audit existing code (use clean-architecture-conformance), for a generic layerless Web API (use dotnet-aspnetcore:dotnet-webapi), or for a microservices-oriented system (out of scope — see the scope note). | user | `/home/diovi/.config/opencode/skills/clean-architecture-scaffold/SKILL.md` |
|
|
32
|
-
| `cognitive-doc-design` | Design docs that reduce cognitive load. Trigger: writing guides, READMEs, RFCs, onboarding, architecture, or review-facing docs. | user | `/home/diovi/.agents/skills/cognitive-doc-design/SKILL.md` |
|
|
33
|
-
| `definition-of-done` | Ingenius Software's technical and architectural Definition of Done (DoD) across 6 levels -- story/task, Pull Request, component/API, release, project closure, and AI -- each with a full narrative criteria list and a condensed, trackable operational checklist (priority, mandatory, risk if not met). Also covers per-modality adaptation, exception management (including who can accept which risk level), a RACI matrix, and tracking metrics. Use when asked whether something is "done," what DoD criteria apply to a story/PR/release/project, how to handle a DoD exception, or who can accept a given risk. Does not cover the per-engagement-modality architecture checklist (a different granularity -- see per-modality-checklist), the full AI design/risk-classification guide (see responsible-ai; this plugin's AI level only lists DoD criteria), which principle a decision affects (architectural-principles), or the ADR/arc42 formats themselves (adr, arc42-template). | user | `/home/diovi/.claude/skills/definition-of-done/SKILL.md` |
|
|
34
|
-
| `delivery-playbook` | Ingenius Software's delivery process by engagement modality -- staffing, closed/fixed-price project, and on-demand development -- each as a short sequence of process steps, plus the minimum deliverables expected per modality. Use when asked what the delivery process looks like for a staffing engagement, a closed project, or on-demand work, or what deliverables a modality requires at minimum. Does not cover the architecture checklist per modality (see per-modality-checklist -- a different tool: checklist controls, not process steps), Definition of Done criteria (see definition-of-done), or roles and escalation (see operating-model). | user | `/home/diovi/.claude/skills/delivery-playbook/SKILL.md` |
|
|
35
|
-
| `find-skills` | Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. | user | `/home/diovi/.agents/skills/find-skills/SKILL.md` |
|
|
36
|
-
| `go-testing` | Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns. | user | `/home/diovi/.agents/skills/go-testing/SKILL.md` |
|
|
37
|
-
| `judgment-day` | Trigger: judgment day, dual review, adversarial review, juzgar. Run explicit blind dual review with at most two scoped fix/re-judgment rounds. | user | `/home/diovi/.agents/skills/judgment-day/SKILL.md` |
|
|
38
|
-
| `operating-model` | Ingenius Software's operating model for architecture governance — roles and responsibilities, the lightweight Architecture Review Board (ARB), the architectural decision flow, escalation criteria, and governance metrics. Use when asked who should be involved in a decision, whether something needs to go to the ARB, when to escalate an architectural decision, what Ingenius's Architecture Review Board looks like, who is responsible for a given governance activity, or how often architecture reviews happen. Complements architectural-principles: that plugin states what the principles are, this one states who applies them, when, and how formally. Does not cover the principles themselves (see architectural-principles) or any artifact's format (ADR, arc42, Definition of Done — separate plugins). | user | `/home/diovi/.claude/skills/operating-model/SKILL.md` |
|
|
39
|
-
| `per-modality-checklist` | Ingenius Software's architecture checklist scaled by engagement modality (closed/fixed-price project, staffing, on-demand work) plus a cross-cutting responsible-AI checklist that applies whenever AI is involved, regardless of modality. Use when asked to set up or verify the architecture checklist for a project given its engagement type, what's required for a closed project vs. staffing vs. on-demand work, or what responsible-AI controls apply to a delivery. Does not cover per-level Definition of Done criteria (story/task, PR, component, release, project closure — see definition-of-done for that different granularity), which principle a decision affects (architectural-principles), or who should review it (operating-model). | user | `/home/diovi/.claude/skills/per-modality-checklist/SKILL.md` |
|
|
40
|
-
| `responsible-ai` | Ingenius Software's guide for designing, building, and operating AI solutions responsibly — the 7 responsible-AI principles, the 4-level risk classification for AI use cases, the AI design checklist, specific controls for generative AI/RAG (data leakage, prompt injection, hallucinations, cost, provider dependency), and the minimum evidence per AI project. Use when classifying an AI use case's risk level, designing a new AI/GenAI/RAG feature, asking what controls apply to a given AI risk, or reviewing an AI project's evidence. Does not replace the shorter responsible-AI verification checklist in per-modality-checklist (a quick pre-delivery gate, one control among several) -- this plugin is the fuller guide behind it, for actually designing and classifying the solution, not just checking it off before shipping. | user | `/home/diovi/.claude/skills/responsible-ai/SKILL.md` |
|
|
41
|
-
| `security-policy` | Ingenius Software's minimum security controls for software development -- identity/access, secrets, data, APIs, dependencies, logging, CI/CD, and AI -- plus a pre-production security checklist. Use when asked what Ingenius's minimum secure-coding controls are, whether something is safe to ship from a security standpoint, or what the pre-production security checklist covers. Does not cover the full responsible-AI risk classification and design guidance (see responsible-ai; this plugin's AI control is a single minimum-control line, not the full guide), or which DoD/architecture-checklist criterion references this checklist (see definition-of-done and per-modality-checklist -- this plugin is the actual content behind their "pre-production checklist" and security-related criteria). | user | `/home/diovi/.claude/skills/security-policy/SKILL.md` |
|
|
42
|
-
| `skill-authoring` | Ingenius Software's own rules for creating, structuring, or reviewing a Claude Code skill, plugin, or marketplace. Use before or instead of skill-creator for any Ingenius skill/plugin/marketplace work. Covers file layout, scope boundaries, English-content standards, verification discipline, and decision logs. Does not cover a skill's own technology-specific domain content. | user | `/home/diovi/.claude/skills/skill-authoring/SKILL.md` |
|
|
43
|
-
| `skill-creator` | Trigger: new skills, agent instructions, documenting AI usage patterns. Create LLM-first skills with valid frontmatter. | user | `/home/diovi/.agents/skills/skill-creator/SKILL.md` |
|
|
44
|
-
| `skill-improver` | Trigger: improve skills, audit skills, refactor skills, skill quality. Audit and upgrade existing LLM-first skills. | user | `/home/diovi/.agents/skills/skill-improver/SKILL.md` |
|
|
45
|
-
| `tech-radar-catalog` | Ingenius Software's central technology radar (which technologies are adopted/trial/assess/hold/retire, and their status) and reusable asset catalog (templates, pipelines, modules, guides), maintained here as living documents rather than copied per project. Use when asked whether a technology is approved for use at Ingenius, what ring or status a technology has, whether a reusable asset, template, starter kit, scaffold, or component already exists for a given need before building it from scratch, or when proposing a new technology or asset to add to either document. This is the one plugin in this marketplace that intentionally holds real, specific-technology content (currently mostly .NET/Azure, since that's Ingenius's only mature stack) rather than agnostic methodology -- see decision log D20 for why. Does not cover the architectural principles behind a technology choice (architectural-principles) or roles/escalation for approving an exception (operating-model). | user | `/home/diovi/.claude/skills/tech-radar-catalog/SKILL.md` |
|
|
46
|
-
| `token-discipline` | Optimize context and token usage without sacrificing technical accuracy. Apply in every session and on every task that reads files, searches code, runs commands, edits files or writes replies, even when the user does not mention tokens or context. | user | `/home/diovi/.agents/skills/token-discipline/SKILL.md` |
|
|
47
|
-
| `venuenexa-guide` | Interactive guide for working on the VenueNexa project (Ingenius, Zoho project INGENIUS-238, tasks PV1-Tnn). Interviews the team member (in Spanish) about what they need to do today and walks them through the agent-first session ritual - review open tasks, pick one, assume the task's role (PM, Analyst, Architect, Dev, DevOps, QA), work with role-specific questions, and close with change summary, WorkDrive upload, role logbook entry and billable hours. Use whenever the user mentions VenueNexa, "empezar el día", "qué tarea hago", "vamos con PV1-T..", "cerrar la sesión", "bitácora", "imputar horas", RESUME HERE, ONBOARDING, INGENIUS-238, or asks what to do next on the project, even if they don't name the skill. Do NOT use for generic Zoho/GitLab questions unrelated to VenueNexa, for Ingenius-wide architecture rules (use architectural-principles, arc42-template, adr, operating-model) or for authoring skills (use skill-authoring). | user | `/home/diovi/.agents/skills/venuenexa-guide/SKILL.md` |
|
|
48
|
-
| `work-unit-commits` | Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code. | user | `/home/diovi/.agents/skills/work-unit-commits/SKILL.md` |
|
|
49
|
-
|
|
50
|
-
## Loading protocol
|
|
51
|
-
|
|
52
|
-
1. Match task context and target files against the `Trigger / description` column.
|
|
53
|
-
2. Pass only the matching `Path` values to the subagent under `## Skills to load before work`.
|
|
54
|
-
3. Instruct the subagent to read those exact `SKILL.md` files before reading, writing, reviewing, testing, or creating artifacts.
|
|
55
|
-
4. If no matching skill exists, proceed without project skill injection and report `skill_resolution: none`.
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx lint-staged
|
package/CLAUDE.md
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file gives Claude Code context on the `release-cherry-pick` repository.
|
|
4
|
-
|
|
5
|
-
## Project overview
|
|
6
|
-
|
|
7
|
-
`release-cherry-pick` is a Node.js CLI (built on Commander) that automates release cherry-picking and GitLab merge-request creation. It's designed to be installed/run as an **external tool from inside another git repo** (the "target" project being released) — this repo is the tool itself, not a project that gets released.
|
|
8
|
-
|
|
9
|
-
- Entry point / bin: `src/index.js` (exposes the `release-cherry-pick` command, `main` in `package.json`)
|
|
10
|
-
- Module system: CommonJS (`require`/`module.exports`), async/await throughout
|
|
11
|
-
- GitLab access is a direct REST client (`src/gitlab/client.js`, native `fetch`) authenticated with a Personal Access Token (scope `api`): `gitlab.token` in config, falling back to the `GITLAB_TOKEN` env var. The project path — and the API host when `gitlab.host` is empty — come from the `origin` remote URL via `parseRemoteUrl` (SCP-like SSH, `ssh://`, `http(s)://` with or without credentials; it checks for a `scheme://` before treating `host:path` as SCP syntax, since `https:` contains a colon too — that misparse used to send HTTPS remotes' requests to a wrong project path and 404). A configured `gitlab.host` wins (for SSH aliases) and goes through `normalizeGitlabHost`, since people paste project/page URLs there (e.g. `https://host/group/proj/-/project_members` — that put the API under the project path and 404'd): it drops everything from GitLab's `/-/` separator and the remote's project path suffix, but keeps any other path as a relative URL root (GitLab under `https://example.com/gitlab`), which `getProjectPathId(config)` then strips from the remote's path. The wizard applies the same normalization when the host is typed, and an http:// remote keeps http for the API. No `glab` dependency.
|
|
12
|
-
|
|
13
|
-
## Commands
|
|
14
|
-
|
|
15
|
-
- `release-cherry-pick release [-f <file> | -b <branches>]` → `runRelease()` in `src/workflow/release.js`. Resolves branches from a file, a CLI list, or interactively, then per branch: create release branch from staging → cherry-pick commits → (if `config.release.autoCreateMR`) push, select a reviewer, and create a GitLab MR via the REST API.
|
|
16
|
-
- `release-cherry-pick config [--init | --show]` → `setupWizard()` (Inquirer) or `loadConfig()`, both in `src/config/`.
|
|
17
|
-
|
|
18
|
-
## Architecture (`src/`)
|
|
19
|
-
|
|
20
|
-
- `cli/` — Commander program factory (`createProgram()`). Note: the actual commands are registered in `src/index.js`, not here — this module only sets name/description/version.
|
|
21
|
-
- `config/` — `defaults.js` (default config shape), `loader.js` (reads/writes the config **outside the project**, at `~/.release-cherry-pick/<project-key>.json` — `RELEASE_CHERRY_PICK_CONFIG_DIR` overrides the directory, which the sandbox uses to keep its config in `<sandbox>/config`. The key comes from the origin remote via `parseRemoteUrl` in `src/git/remote-url.js` (`host_group_proj`, the same for SSH and HTTPS clones), or the repo folder name + a hash of its path when there's no remote; it's resolved once per cwd with sync `git` calls, since load/save are sync. Saved with 0700/0600 modes; `loadConfig()` deep-merges the file over the defaults so options missing from older files are always present, then runs `validateConfig` — pass `{ validate: false }` to skip, as the wizard does so it can repair a broken file), `setup.js` (Inquirer wizard: asks every option incl. `release.*`; when `autoCreateMR` is on it lists real project members via the REST client to pick `defaultReviewers`/`defaultAssignees`, falling back to typed usernames if there's no token or the call fails — it deliberately doesn't call `ensureAuthenticated`, which prompts for a token and saves the config mid-wizard, bypassing the review/cancel step), `validator.js` (`validateConfig`: type-checks the full merged config and throws one `ConfigError` listing every problem).
|
|
22
|
-
- `git/` — `branch-parser.js` (parses `*TASK-ID*: description` lines — no branch-name field), `branch-selector.js` (`getRemoteBranches` fetches then lists `feature/*`/`hotfix/*` remote branches; `resolveBranchNameForTaskId(taskId, branches?)` finds the real remote branch(es) matching a task ID, used by the `--file` input path instead of guessing a name), `release-branch.js` (`buildReleaseBranchName`/`createReleaseBranch`/`pushBranch` — creates `release/<original-branch-name-with-known-prefix-stripped>` off staging; if the release branch already exists remotely *or locally* (exact name match) it does **not** auto-offer to delete/overwrite it — that's a destructive op on a shared branch — it just reports failure and leaves it for the user to resolve manually), `cherry-pick.js` (cherry-pick via `git.raw(['cherry-pick', ...])`; see "Commit selection" below), `release-status.js` (`ReleaseStatus` class — tracks per-branch `PROCEDE` / `NO PROCEDE` / `CONFLICT` / `SKIPPED` outcomes).
|
|
23
|
-
- `git/instance.js` — the only place `simple-git` is instantiated: `createGit()` passes `allowEnvironment: ['GIT_CONFIG_COUNT', 'GIT_CONFIG_KEY_0', 'GIT_CONFIG_VALUE_0']`. simple-git v4 strips ambient `GIT_*` variables from the git child process, which would silently drop the token header `git-auth.js` injects (and send every HTTPS push/pull back to git's interactive credential prompt). Note the option is spelled `allowEnvironment` in the code even though the v4 docs write `allowEnvoronment` — using the documented spelling does nothing. Every module must use `createGit()`, never `simpleGit()` directly.
|
|
24
|
-
- `gitlab/client.js` — REST client (native `fetch`, no shelling out): `ensureAuthenticated` (resolves PAT from `gitlab.token`/`GITLAB_TOKEN` or prompts interactively, validates via `GET /user`), `getProjectMembers` (`GET /projects/:id/members/all` with pagination), `createMergeRequest` (`POST /projects/:id/merge_requests`, maps reviewer usernames → `reviewer_ids`). Project path is derived from the `origin` remote URL.
|
|
25
|
-
- `gitlab/` — `client.js` (REST API as above), `mr-creator.js` (orchestrates: fallback title/description from `config.release.mrTitleFormat` + commit list, tries AI content, then calls `gitlab.createMergeRequest` with squash/remove-source-branch flags and `config.release.defaultAssignees`, which the client maps from usernames to `assignee_ids` like reviewers → `reviewer_ids`), `ai-description.js` (real Anthropic integration — see below), `reviewer-selector.js` (Inquirer checkbox over project members, pre-checking `config.release.defaultReviewers`, or legacy `defaultReviewerPattern` matches if that list is empty).
|
|
26
|
-
- `doc/` — `agents-generator.js` / `rpd-generator.js`: write `AGENTS.md` / `RPD.md` into the **target** project's root (prompt before overwrite).
|
|
27
|
-
- `report/` — `summary.js`: console + markdown release summaries (`PROCEDE`/`NO PROCEDE`/`CONFLICT`/`SKIPPED` status).
|
|
28
|
-
- `git/repo-state.js` — `captureStartingPoint()` (preflight run first thing in `runRelease`: refuses to start with uncommitted changes to tracked files or a cherry-pick in progress — untracked files are fine — and records the current branch, or commit if detached) and `restoreStartingPoint()` (run in a `finally` after the branch loop: aborts a leftover cherry-pick, checks the starting point back out, then deletes the release branches this run created that ended up empty — CONFLICT, SKIPPED or error, never pushed. PROCEDE branches, and any release branch that existed before the run, are never deleted). Note: `CHERRY_PICK_HEAD` is checked as a file, because simple-git's `raw()` doesn't reject when a git command fails without writing to stderr. `runInterruptible(work, cleanup)` wraps the branch loop so Ctrl+C also runs that cleanup: the first SIGINT sets `signal.interrupted` (the loop checks it between steps and stops; the branch in progress is discarded unless it was already pushed), then cleans up once the loop stops — or after a 2 s grace period if it's stuck on an Inquirer prompt, whose promise never settles — and exits 130; a second Ctrl+C exits immediately. While it runs it also shims `process.kill(process.pid, 'SIGINT')` (what Inquirer calls on Ctrl+C in a prompt) into a plain `SIGINT` event, because on Windows `process.kill` terminates the process unconditionally, skipping every handler.
|
|
29
|
-
- `workflow/release.js` — the main orchestrator (`runRelease`) tying config, GitLab token preflight, branch resolution, cherry-picking, reviewer selection, MR creation, and reporting together.
|
|
30
|
-
- `utils/` — `errors.js` (`AppError` base, subclassed by `ConfigError`/`GitError`/`GitLabError`), `logger.js` (chalk-based colored logger: `info/warn/error/success/header/table`).
|
|
31
|
-
|
|
32
|
-
## Commit selection for cherry-pick (important, found via real-world testing)
|
|
33
|
-
|
|
34
|
-
`getCommitsToCherryPick(sourceBranch, taskId, baseBranch)` in `src/git/cherry-pick.js` does **not** diff `sourceBranch` against `baseBranch` as a plain range. That was the original approach and it breaks in practice: real branches are often cut from a much older/different base than current `staging` (e.g. `develop` synced only periodically), so `staging..branch` can pull in hundreds of unrelated commits, or (if the branch's work already landed elsewhere) `develop..branch` can show zero commits even though the fix is genuinely still missing from `staging`. Verified against a real PROBROKER branch: `staging..hotfix/PB-I3245-...` returned 606 unrelated commits.
|
|
35
|
-
|
|
36
|
-
Instead it matches commits by the team's own `"[TASK-ID] description"` commit message convention (used consistently — 234/13687 commits in one real repo), restricted to commits not already reachable from `baseBranch`: `git log origin/<branch> --grep='^\[TASK-ID\]' --extended-regexp --regexp-ignore-case --not origin/<baseBranch> --reverse`. This reliably isolates just this task's own commit(s) regardless of the branch's real topology. `runRelease` passes `branchInfo.taskId` as the match key. Git's `--grep` matches any line of the message, so results are then filtered to commits tagged in the **title** (simple-git's `message` is the subject).
|
|
37
|
-
|
|
38
|
-
Commits that mention the task ID without following the convention (`PB-700: fix`, `(PB-700) fix`, or the tag only in the body) would otherwise be left out of the release silently. `findLooseTaskCommits` finds them among the branch's commits not on `baseBranch` (excluding merges, titles tagged for another task, and IDs that merely start the same, e.g. PB-7000). `selectTaskCommits` in `release.js` lists them, asks whether to include them (default no; `orderCommitsByHistory` keeps branch order when mixing), and records the outcome as a note (`ReleaseStatus.addNote`) shown under the task in the console summary and `release-summary.md`. Commits with no ID at all aren't reported: they can't be told apart from unrelated history on branches cut from an old base.
|
|
39
|
-
|
|
40
|
-
A cherry-pick can also come back **empty** (git: "The previous cherry-pick is now empty...") when the commit's net change is already present in the target tree (e.g. the same fix landed a different way) — this is not a real conflict, even though git's own message contains the word "conflict" in passing. `cherry-pick.js` distinguishes this from a real conflict by checking `git status().conflicted` — if there are no actually-conflicted files, it treats it as already-applied, runs `git cherry-pick --skip`, and keeps going (does not abort the branch). `runRelease` checks `cherryPickResult.commitsCherryPicked === 0` after a "success" and marks the branch `SKIPPED` (no push, no MR — nothing to release) rather than `PROCEDE`.
|
|
41
|
-
|
|
42
|
-
## AI-generated MR content
|
|
43
|
-
|
|
44
|
-
`src/gitlab/ai-description.js` calls the Anthropic Messages API (`@anthropic-ai/sdk`) to draft the MR title and description from the branch's commits, gated on `config.ai.enabled`. API key resolves from `config.ai.apiKey`, falling back to the `ANTHROPIC_API_KEY` env var. Default model: `config.ai.model` (default `claude-haiku-4-5-20251001`). On any failure (disabled, no key, API error, bad JSON) it returns `null` and `mr-creator.js` falls back to the static `config.release.mrTitleFormat` + commit-list template.
|
|
45
|
-
|
|
46
|
-
## Conventions
|
|
47
|
-
|
|
48
|
-
- Always log via `src/utils/logger.js`, not raw `console.log` (a couple of `console.log(JSON.stringify(...))` calls exist only for `config --show`, which prints a copy with `gitlab.token` and `ai.apiKey` masked via `maskSecret` in `src/utils/secrets.js`).
|
|
49
|
-
- Secret prompts (GitLab token, AI API key) must use Inquirer `type: 'password'` with `mask: '*'` — in inquirer 8, `mask` on a `type: 'input'` prompt is silently ignored and the secret is echoed in clear.
|
|
50
|
-
- AI defaults: `ai.provider`/`ai.model`/`ai.baseURL` default to `''` on purpose — `ensureAiSettings` (in `setup.js`) prompts for provider/model at release time when AI is enabled and they're missing, and an empty `baseURL` lets `resolveBaseURL` pick each provider's own endpoint (a non-empty `config.ai.baseURL` wins for *any* provider).
|
|
51
|
-
- Errors: throw the appropriate `AppError` subclass; top-level handlers in `src/index.js` catch, log `error.message`, and `process.exit(1)`.
|
|
52
|
-
- Config is plaintext JSON kept in the developer's home directory (see `loader.js` above), never in the target repo, so its secrets can't be committed by accident — no `.gitignore` handling is needed or done. It holds `gitlab.token` (PAT with `api` scope; can also come from `GITLAB_TOKEN` env) and optional `gitlab.host`; the project id is resolved from the `origin` remote, not stored.
|
|
53
|
-
- Branch naming: original branches are `feature/*`/`hotfix/*`; release branches are `release/<original-name-with-known-prefix-stripped>` (e.g. `feature/PB-123-list-user` → `release/PB-123-list-user`) via `buildReleaseBranchName` in `src/git/release-branch.js`. Prefixes configurable via `git.branchPrefix` and honored everywhere: the release prefix names the release branch, and every non-release prefix (`getSourcePrefixes` in `src/git/branch-selector.js`, falling back to the defaults if none configured) defines which remote branches are listed/matched by task ID. Staging branch defaults to `staging`.
|
|
54
|
-
- Task IDs: uppercase alphanumeric with hyphen, e.g. `PB-I3217` (regex in `src/git/branch-parser.js`).
|
|
55
|
-
- MR titles: `config.release.mrTitleFormat` (default `[{taskId}] {description}`), used as the fallback when AI generation is off/fails; AI-generated titles are instructed to keep the `[{taskId}] ` prefix.
|
|
56
|
-
- MR options: `config.release.mrSquash` / `config.release.mrRemoveSourceBranch` both default `true` (GitLab's squash + delete-source-branch checkboxes), sent as `squash` / `remove_source_branch` on `POST /projects/:id/merge_requests`.
|
|
57
|
-
- Reviewer: `config.release.defaultReviewerPattern` (default `'^che(i|y)ner$'`) is matched case-insensitively against real project members (`gitlab.getProjectMembers()`) to preselect a default in the per-branch reviewer prompt; selected usernames are mapped to numeric `reviewer_ids` before the MR is created.
|
|
58
|
-
- Domain terminology is Spanish-influenced (`PROCEDE`/`NO PROCEDE`/`CONFLICT`/`SKIPPED` status, `'es-ES'` locale in generated `RPD.md`), reflecting the team's locale.
|
|
59
|
-
- `simple-git@4.0.2` (upgraded from `^3.36.0` for the critical advisories fixed in 4.0.2) has **no `cherryPick()` method** — cherry-pick operations must go through `git.raw(['cherry-pick', ...])`, not a hypothetical `git.cherryPick(...)`. v4 also removed the default export (`const { simpleGit } = require('simple-git')` returns an object, not a function) and blocks abbreviated long-form options (`--conf=` → `GitConfigurationError`), so keep passing full option names — all of this suite's `raw()` args are already canonical.
|
|
60
|
-
|
|
61
|
-
## Build / test
|
|
62
|
-
|
|
63
|
-
- `npm start` — runs the CLI (`node src/index.js`).
|
|
64
|
-
- `npm test` — placeholder only (`echo "Tests not yet implemented"`), not a real test runner.
|
|
65
|
-
- `node test-e2e.js` — manual smoke script (no assertions) exercising branch parsing, config defaults, `ReleaseStatus`, markdown summary, and doc generation. Not wired to `npm test`.
|
|
66
|
-
- `npm run sandbox:create` / `npm run sandbox:run -- [-b <list> | -f tasks.txt]` — synthetic disposable sandbox (`scripts/sandbox/`): a local bare `origin` + clone in `$TMPDIR/release-cherry-pick-sandbox` with branches covering each scenario (normal, untagged commit, conflict, already-applied → `SKIPPED`, duplicate task ID, no task ID), config `autoCreateMR: false` (no push/GitLab API). `run-release.js` auto-answers Inquirer prompts; `npm run sandbox:config` runs the setup wizard the same way. Shared `harness.js` flags: `--fake-gitlab` (intercepts `fetch()` to `/api/v4` and sets a fake `GITLAB_TOKEN`, so the real `src/gitlab/client.js` runs against a fake — fixed members, `POST merge_requests` prints its body) and auto-answers the searchable `autocomplete`/`checkbox-plus` prompts from `src/utils/prompts.js` too and `--answer name=value` (force a prompt's answer). Use this to validate git-flow changes before touching any real repo.
|
|
67
|
-
- `npm run lint` / `npm run lint:fix` — ESLint (flat config, `eslint.config.js`, `eslint:recommended` + CommonJS/Node globals). A Husky `pre-commit` hook (`.husky/pre-commit`) runs `lint-staged` (`*.js` → `eslint --fix`) automatically on every commit, only against staged files. Hooks are installed with `npm run setup` (runs `husky` once after cloning) — there is deliberately **no `prepare` lifecycle script**, so nothing hook-related ships in the published package (`npm pack`/`npm publish` never runs it either). No Prettier config present (despite AGENTS.md-generated output claiming ESLint conventions for target projects — that doc is about *target* projects, not this repo).
|
|
68
|
-
- `npm run test:package` — end-to-end test of the **published npm artifact**, not the checkout (`scripts/sandbox/test-package.js`; flags `--version <v>`, `--sandbox <dir>`, `--keep`). Phase 1 downloads the registry tarball and checks `dist.integrity`, file list (no `.env`/keys/`.git`, no `preinstall`/`install`/`postinstall` scripts), MIT license vs `LICENSE`, `type: 'password'`+`mask: '*'` on every secret prompt, and scans shipped files for secrets (documentary placeholders excluded). Phase 2 runs a real `npm install` of the tarball into a sandbox prefix, exercises the bin (`--version`, `--help`, `config --show` with `RELEASE_CHERRY_PICK_CONFIG_DIR`) asserting the real `~/.release-cherry-pick` stays untouched, plus `npm audit`. Phase 3 runs the mutated flow twice via `run-release.js --tool <installed-copy>`: `autoCreateMR: false` (nothing pushed; only PROCEDE branches kept locally; exactly the tagged commits picked, staging untouched) and `autoCreateMR: true` against `--fake-gitlab` (push + MR body asserted) — the sandbox's origin is rewritten to `https://gitlab.example.com/sandbox/project.git` with `url.*.insteadOf` pointing back at the local bare repo, and a `git` shim on PATH returns the raw URL for `git remote get-url` (which would otherwise apply insteadOf and break `parseRemoteUrl`); the config must be written with that same shim in PATH or its project key won't match. Phase 4 writes a config containing fake PAT/AI key and asserts `0600`/`0700` modes, no raw secret in console output, `release-summary.md` or git metadata, and masked `config --show`. Phase 5 runs against the local checkout: simple-git must resolve to ≥4.0.2 (the version that fixes the criticals), and a probe proves the `GIT_CONFIG_*` token header reaches git through `createGit()` while a plain `simpleGit()` instance strips it (the allow-list is load-bearing). Currently: 83/83 checks, 2 warnings (shipped `prepare: husky || true`; `npm audit` of the *published* 1.0.0, which still pins `^3.36.0` and reports simple-git ≤4.0.1 criticals — clean once the fixed version is republished).
|
|
69
|
-
- The GitLab REST paths used in `src/gitlab/client.js` (`GET /user`, `GET /projects/:id/members/all`, `POST /projects/:id/merge_requests`, `PRIVATE-TOKEN` auth header, `reviewer_ids`) follow the public GitLab API docs but were **not** live-verified against a real instance from this environment (no token configured here). Re-verify with a test project if MR creation misbehaves.
|
|
70
|
-
- The branch-creation, commit-selection, and empty-cherry-pick logic (everything in "Commit selection for cherry-pick" above) *was* validated against real data: a disposable local mirror clone of an actual production repo (PROBROKER, `gitlab.ingeniuscuba.com`), never pushed to or otherwise touching the real remote. MR creation/reviewer-listing/AI generation were not exercised this way (no real GitLab MR was created, no Anthropic key configured).
|
|
71
|
-
|
|
72
|
-
## Other tooling in this repo
|
|
73
|
-
|
|
74
|
-
`openspec/` holds spec-driven planning artifacts (proposal/design/tasks docs) used to plan this project's own features — not part of the CLI's runtime behavior. `.agents/`, `.kilocode/`, `.kimi-code/`, `.opencode/` contain mirrored `openspec-*` workflow skills for various AI coding tools, plus one generic (non-project-specific) `nodejs-backend-patterns` skill.
|
package/eslint.config.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const js = require('@eslint/js');
|
|
2
|
-
|
|
3
|
-
module.exports = [
|
|
4
|
-
js.configs.recommended,
|
|
5
|
-
{
|
|
6
|
-
languageOptions: {
|
|
7
|
-
ecmaVersion: 2022,
|
|
8
|
-
sourceType: 'commonjs',
|
|
9
|
-
globals: {
|
|
10
|
-
require: 'readonly',
|
|
11
|
-
module: 'readonly',
|
|
12
|
-
exports: 'writable',
|
|
13
|
-
process: 'readonly',
|
|
14
|
-
console: 'readonly',
|
|
15
|
-
__dirname: 'readonly',
|
|
16
|
-
__filename: 'readonly',
|
|
17
|
-
Buffer: 'readonly',
|
|
18
|
-
fetch: 'readonly',
|
|
19
|
-
AbortController: 'readonly',
|
|
20
|
-
URL: 'readonly',
|
|
21
|
-
setTimeout: 'readonly',
|
|
22
|
-
setInterval: 'readonly',
|
|
23
|
-
clearTimeout: 'readonly',
|
|
24
|
-
clearInterval: 'readonly',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
rules: {
|
|
28
|
-
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
ignores: ['node_modules/**', 'openspec/**', '.agents/**', '.kilocode/**', '.kimi-code/**', '.opencode/**'],
|
|
33
|
-
},
|
|
34
|
-
];
|
|
File without changes
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
## Context
|
|
2
|
-
|
|
3
|
-
El proyecto es una CLI Node.js que se ejecuta como herramienta externa en otros proyectos para automatizar el proceso de release mediante cherry-pick y creación de Merge Requests en GitLab. Actualmente no existe código base - el proyecto se construirá desde cero.
|
|
4
|
-
|
|
5
|
-
## Goals / Non-Goals
|
|
6
|
-
|
|
7
|
-
**Goals:**
|
|
8
|
-
- Crear una CLI modular y extensible con arquitectura clara
|
|
9
|
-
- Implementar todas las capacidades definidas en los specs
|
|
10
|
-
- Mantener el proyecto simple y fácil de mantener
|
|
11
|
-
- Proporcionar una experiencia de usuario fluida mediante interacción CLI
|
|
12
|
-
|
|
13
|
-
**Non-Goals:**
|
|
14
|
-
- No implementar interfaz gráfica (solo CLI)
|
|
15
|
-
- No soportar otros proveedores de control de versiones (solo Git/GitLab)
|
|
16
|
-
- No implementar autenticación OAuth (solo tokens personales)
|
|
17
|
-
- No crear un servicio web o API
|
|
18
|
-
|
|
19
|
-
## Decisions
|
|
20
|
-
|
|
21
|
-
### Decision 1: Arquitectura modular con separación de responsabilidades
|
|
22
|
-
|
|
23
|
-
**Choice**: Estructura de carpetas por dominio (cli-core, config, cherry-pick, gitlab, etc.)
|
|
24
|
-
|
|
25
|
-
**Rationale**:
|
|
26
|
-
- Facilita testing y mantenimiento
|
|
27
|
-
- Permite desarrollar y probar módulos independientemente
|
|
28
|
-
- Sigue principios de SOLID y Clean Architecture
|
|
29
|
-
|
|
30
|
-
**Alternatives considered**:
|
|
31
|
-
- Estructura plana: Rechazada por dificultad de mantenimiento a medida que crece el proyecto
|
|
32
|
-
- Arquitectura hexagonal: Demasiado compleja para una CLI de este tamaño
|
|
33
|
-
|
|
34
|
-
### Decision 2: Framework CLI - Commander.js
|
|
35
|
-
|
|
36
|
-
**Choice**: Commander.js para parsing de argumentos
|
|
37
|
-
|
|
38
|
-
**Rationale**:
|
|
39
|
-
- Ampliamente usado y probado
|
|
40
|
-
- Soporte nativo para subcomandos
|
|
41
|
-
- Buena documentación y comunidad
|
|
42
|
-
- Ligero y sin dependencias innecesarias
|
|
43
|
-
|
|
44
|
-
**Alternatives considered**:
|
|
45
|
-
- Yargs: Más complejo, mejor para CLIs con muchas opciones
|
|
46
|
-
- Inquirer.js: Solo para prompts interactivos, no para parsing principal
|
|
47
|
-
- Meow: Más minimalista, menos features
|
|
48
|
-
|
|
49
|
-
### Decision 3: Interacción CLI - Inquirer.js
|
|
50
|
-
|
|
51
|
-
**Choice**: Inquirer.js para prompts interactivos
|
|
52
|
-
|
|
53
|
-
**Rationale**:
|
|
54
|
-
- Mejor experiencia de usuario para selección de ramas
|
|
55
|
-
- Soporte para listas, confirmaciones, inputs
|
|
56
|
-
- Fácil de usar y personalizar
|
|
57
|
-
|
|
58
|
-
**Alternatives considered**:
|
|
59
|
-
- Prompt: Más básico
|
|
60
|
-
- Readline: Nativo de Node pero más工作 intensivo
|
|
61
|
-
|
|
62
|
-
### Decision 4: Cliente GitLab - Axios + GitLab API
|
|
63
|
-
|
|
64
|
-
**Choice**: Axios para llamadas HTTP a GitLab API
|
|
65
|
-
|
|
66
|
-
**Rationale**:
|
|
67
|
-
- Control total sobre las llamadas API
|
|
68
|
-
- Fácil de implementar y testear
|
|
69
|
-
- Sin dependencias adicionales innecesarias
|
|
70
|
-
|
|
71
|
-
**Alternatives considered**:
|
|
72
|
-
- gitlab-api npm package: Menos control, dependencia adicional
|
|
73
|
-
- Octokit: Más para GitHub, no GitLab
|
|
74
|
-
|
|
75
|
-
### Decision 5: Ejecución de comandos Git - simple-git
|
|
76
|
-
|
|
77
|
-
**Choice**: simple-git para ejecutar comandos Git
|
|
78
|
-
|
|
79
|
-
**Rationale**:
|
|
80
|
-
- API simple y consistente
|
|
81
|
-
- Manejo de errores integrado
|
|
82
|
-
- Evita usar child_process directamente (más seguro)
|
|
83
|
-
|
|
84
|
-
**Alternatives considered**:
|
|
85
|
-
- isomorphic-git: Más complejo, mejor para apps web
|
|
86
|
-
- child_process: Más trabajo, propenso a errores
|
|
87
|
-
|
|
88
|
-
### Decision 6: Estructura de configuración
|
|
89
|
-
|
|
90
|
-
**Choice**: Archivo JSON `.release-cherry-pick.json` en raíz del proyecto
|
|
91
|
-
|
|
92
|
-
**Rationale**:
|
|
93
|
-
- Simple y nativo de Node.js
|
|
94
|
-
- Fácil de leer y modificar manualmente
|
|
95
|
-
- No requiere dependencias adicionales
|
|
96
|
-
|
|
97
|
-
**Alternatives considered**:
|
|
98
|
-
- YAML: Más legible pero requiere librería adicional
|
|
99
|
-
- dotenv: Solo para variables de entorno, no estructurado
|
|
100
|
-
|
|
101
|
-
## Risks / Trade-offs
|
|
102
|
-
|
|
103
|
-
**Risk: GitLab API rate limiting**
|
|
104
|
-
→ Mitigation: Implementar reintentos con backoff exponencial y caché de resultados
|
|
105
|
-
|
|
106
|
-
**Risk: Conflictos de cherry-pick no resolubles automáticamente**
|
|
107
|
-
→ Mitigation: Marcar como NO PROCEDE y proporcionar instrucciones claras al usuario
|
|
108
|
-
|
|
109
|
-
**Risk: Tokens de GitLab expuestos en logs**
|
|
110
|
-
→ Mitigation: Nunca loggear tokens, usar variables de entorno cuando sea posible
|
|
111
|
-
|
|
112
|
-
**Risk: Cambios en GitLab API**
|
|
113
|
-
→ Mitigation: Usar versionado de API y documentar endpoints usados
|
|
114
|
-
|
|
115
|
-
**Trade-off: Simplicidad vs Flexibilidad**
|
|
116
|
-
→ Decisión: Priorizar simplicidad para el caso de uso principal, permitir extensibilidad básica
|
|
117
|
-
|
|
118
|
-
## Migration Plan
|
|
119
|
-
|
|
120
|
-
No aplica - proyecto nuevo desde cero.
|
|
121
|
-
|
|
122
|
-
## Open Questions
|
|
123
|
-
|
|
124
|
-
1. ¿Se debe soportar múltiples proyectos GitLab simultáneamente?
|
|
125
|
-
2. ¿Qué nivel de logging se necesita (verbose, debug, quiet)?
|
|
126
|
-
3. ¿Se debe implementar modo dry-run para pruebas?
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## Why
|
|
2
|
-
|
|
3
|
-
El proyecto actual necesita una herramienta CLI en Node.js que automatice el proceso de release mediante cherry-pick de ramas feature/hotfix hacia ramas de release, y la creación de Merge Requests en GitLab. Este proceso es manual, propenso a errores y consume tiempo significativo del equipo de desarrollo. La herramienta permitirá estandarizar el proceso, reducir errores humanos y agilizar los releases.
|
|
4
|
-
|
|
5
|
-
## What Changes
|
|
6
|
-
|
|
7
|
-
- Crear una CLI en Node.js que se ejecute como herramienta externa en proyectos existentes
|
|
8
|
-
- Implementar gestión de configuración persistente (ramas, proveedores Git, integración IA)
|
|
9
|
-
- Soporte para listas de ramas predefinidas o selección interactiva desde el repositorio
|
|
10
|
-
- Automatización del flujo: cherry-pick → detección de conflictos → creación de MR en GitLab
|
|
11
|
-
- Generación de reportes de resumen con estado del release (PROCEDE/NO PROCEDE)
|
|
12
|
-
- Creación de documentación AGENTS.md y RPD.md
|
|
13
|
-
|
|
14
|
-
## Capabilities
|
|
15
|
-
|
|
16
|
-
### New Capabilities
|
|
17
|
-
|
|
18
|
-
- `cli-core`: Estructura base de la CLI con manejo de argumentos, configuración yLogging
|
|
19
|
-
- `config-management`: Gestión de configuraciones persistentes (ramas, proveedores Git, opciones IA)
|
|
20
|
-
- `branch-selection`: Selección de ramas mediante lista predefinida o interacción con el repositorio
|
|
21
|
-
- `cherry-pick-orchestration`: Orquestación del proceso de cherry-pick con manejo de conflictos
|
|
22
|
-
- `gitlab-integration`: Integración con GitLab API para creación de Merge Requests
|
|
23
|
-
- `release-summary`: Generación de reportes de resumen del proceso de release
|
|
24
|
-
- `documentation-generation`: Generación automática de AGENTS.md y RPD.md
|
|
25
|
-
|
|
26
|
-
### Modified Capabilities
|
|
27
|
-
|
|
28
|
-
<!-- No hay capacidades existentes a modificar - este es un proyecto nuevo -->
|
|
29
|
-
|
|
30
|
-
## Impact
|
|
31
|
-
|
|
32
|
-
- **Código**: Nuevo proyecto Node.js completo con estructura modular
|
|
33
|
-
- **Dependencias**:
|
|
34
|
-
- Node.js runtime
|
|
35
|
-
- Librería para interacción CLI (inquirer.js o similar)
|
|
36
|
-
- Cliente GitLab API (axios + gitlab API o librería dedicada)
|
|
37
|
-
- Manejo de procesos child para git commands
|
|
38
|
-
- **Sistemas**: Requiere acceso a GitLab API con permisos para crear MRs
|
|
39
|
-
- **Documentación**: Genera AGENTS.md y RPD.md como parte del proceso
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
## Purpose
|
|
2
|
-
|
|
3
|
-
Permitir la selección de ramas mediante listas predefinidas o interacción directa con el repositorio Git.
|
|
4
|
-
|
|
5
|
-
## ADDED Requirements
|
|
6
|
-
|
|
7
|
-
### Requirement: Branch list file support
|
|
8
|
-
The system SHALL support reading branches from a predefined list file.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Load branches from file
|
|
11
|
-
- **WHEN** user provides a file path with branch list
|
|
12
|
-
- **THEN** the system SHALL parse the file and extract branch names matching the pattern `*TASK-ID*: Description`
|
|
13
|
-
|
|
14
|
-
#### Scenario: Parse branch format
|
|
15
|
-
- **WHEN** parsing branch list entries
|
|
16
|
-
- **THEN** the system SHALL extract task ID and branch name from each line
|
|
17
|
-
|
|
18
|
-
### Requirement: Interactive branch selection
|
|
19
|
-
The system SHALL provide interactive branch selection when no file is provided.
|
|
20
|
-
|
|
21
|
-
#### Scenario: List available branches
|
|
22
|
-
- **WHEN** user chooses interactive selection
|
|
23
|
-
- **THEN** the system SHALL list all feature and hotfix branches from the repository
|
|
24
|
-
|
|
25
|
-
#### Scenario: Search branches
|
|
26
|
-
- **WHEN** user wants to search for specific branches
|
|
27
|
-
- **THEN** the system SHALL provide a search/filter functionality
|
|
28
|
-
|
|
29
|
-
#### Scenario: Select multiple branches
|
|
30
|
-
- **WHEN** user selects branches for release
|
|
31
|
-
- **THEN** the system SHALL allow selecting multiple branches simultaneously
|
|
32
|
-
|
|
33
|
-
### Requirement: Branch validation
|
|
34
|
-
The system SHALL validate that selected branches exist and are accessible.
|
|
35
|
-
|
|
36
|
-
#### Scenario: Validate branch exists
|
|
37
|
-
- **WHEN** a branch is selected
|
|
38
|
-
- **THEN** the system SHALL verify the branch exists in the remote repository
|
|
39
|
-
|
|
40
|
-
#### Scenario: Validate branch is mergeable
|
|
41
|
-
- **WHEN** a branch is selected
|
|
42
|
-
- **THEN** the system SHALL check if the branch can be merged without conflicts
|
package/openspec/changes/node-cli-release-cherry-pick/specs/cherry-pick-orchestration/spec.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
## Purpose
|
|
2
|
-
|
|
3
|
-
Orquestar el proceso de cherry-pick de ramas feature/hotfix hacia ramas de release con manejo de conflictos.
|
|
4
|
-
|
|
5
|
-
## ADDED Requirements
|
|
6
|
-
|
|
7
|
-
### Requirement: Release branch creation
|
|
8
|
-
The system SHALL create release branches from the staging branch.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Create release branch from staging
|
|
11
|
-
- **WHEN** user initiates release process
|
|
12
|
-
- **THEN** the system SHALL create a new branch from staging with the pattern `release/<task-id>-<description>`
|
|
13
|
-
|
|
14
|
-
#### Scenario: Handle existing release branch
|
|
15
|
-
- **WHEN** a release branch already exists
|
|
16
|
-
- **THEN** the system SHALL ask user whether to overwrite or skip
|
|
17
|
-
|
|
18
|
-
### Requirement: Cherry-pick execution
|
|
19
|
-
The system SHALL execute cherry-pick of commits from source branches to release branches.
|
|
20
|
-
|
|
21
|
-
#### Scenario: Cherry-pick single commit
|
|
22
|
-
- **WHEN** source branch has commits to cherry-pick
|
|
23
|
-
- **THEN** the system SHALL execute `git cherry-pick` for each commit
|
|
24
|
-
|
|
25
|
-
#### Scenario: Cherry-pick multiple commits
|
|
26
|
-
- **WHEN** source branch has multiple commits
|
|
27
|
-
- **THEN** the system SHALL cherry-pick commits in chronological order
|
|
28
|
-
|
|
29
|
-
### Requirement: Conflict detection and handling
|
|
30
|
-
The system SHALL detect and handle cherry-pick conflicts.
|
|
31
|
-
|
|
32
|
-
#### Scenario: Detect conflicts
|
|
33
|
-
- **WHEN** cherry-pick encounters conflicts
|
|
34
|
-
- **THEN** the system SHALL mark the operation as "NO PROCEDE" and log the conflicting files
|
|
35
|
-
|
|
36
|
-
#### Scenario: Report conflict details
|
|
37
|
-
- **WHEN** conflicts are detected
|
|
38
|
-
- **THEN** the system SHALL display which files have conflicts and suggest resolution
|
|
39
|
-
|
|
40
|
-
### Requirement: Success tracking
|
|
41
|
-
The system SHALL track which cherry-picks succeeded and which failed.
|
|
42
|
-
|
|
43
|
-
#### Scenario: Mark successful cherry-pick
|
|
44
|
-
- **WHEN** cherry-pick completes without conflicts
|
|
45
|
-
- **THEN** the system SHALL mark the operation as "PROCEDE"
|
|
46
|
-
|
|
47
|
-
#### Scenario: Generate operation report
|
|
48
|
-
- **WHEN** all cherry-picks are complete
|
|
49
|
-
- **THEN** the system SHALL generate a summary showing PROCEDE/NO PROCEDE status for each branch
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
## Purpose
|
|
2
|
-
|
|
3
|
-
Proporcionar la estructura base de la CLI con manejo de argumentos, configuración y logging para el proceso de release cherry-pick.
|
|
4
|
-
|
|
5
|
-
## ADDED Requirements
|
|
6
|
-
|
|
7
|
-
### Requirement: CLI entry point
|
|
8
|
-
The system SHALL provide a CLI entry point that can be executed via `node` or as a global command after installation.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Execute CLI command
|
|
11
|
-
- **WHEN** user runs `npx release-cherry-pick` or the installed CLI command
|
|
12
|
-
- **THEN** the CLI SHALL initialize and display the main menu or execute the specified command
|
|
13
|
-
|
|
14
|
-
### Requirement: Argument parsing
|
|
15
|
-
The system SHALL parse command-line arguments to determine the operation mode.
|
|
16
|
-
|
|
17
|
-
#### Scenario: Parse --help argument
|
|
18
|
-
- **WHEN** user runs `release-cherry-pick --help`
|
|
19
|
-
- **THEN** the system SHALL display usage information and available commands
|
|
20
|
-
|
|
21
|
-
#### Scenario: Parse --version argument
|
|
22
|
-
- **WHEN** user runs `release-cherry-pick --version`
|
|
23
|
-
- **THEN** the system SHALL display the current version number
|
|
24
|
-
|
|
25
|
-
### Requirement: Logging system
|
|
26
|
-
The system SHALL implement a logging system that outputs messages to the console.
|
|
27
|
-
|
|
28
|
-
#### Scenario: Log info messages
|
|
29
|
-
- **WHEN** the system needs to display informational messages
|
|
30
|
-
- **THEN** messages SHALL be displayed in green color for success, yellow for warnings, and red for errors
|
|
31
|
-
|
|
32
|
-
### Requirement: Error handling
|
|
33
|
-
The system SHALL handle errors gracefully and provide meaningful error messages.
|
|
34
|
-
|
|
35
|
-
#### Scenario: Handle missing dependencies
|
|
36
|
-
- **WHEN** required system dependencies are missing (git, node)
|
|
37
|
-
- **THEN** the system SHALL display a clear error message indicating which dependency is missing and how to install it
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
## Purpose
|
|
2
|
-
|
|
3
|
-
Gestionar configuraciones persistentes incluyendo ramas, proveedores Git y opciones de IA para el proceso de release.
|
|
4
|
-
|
|
5
|
-
## ADDED Requirements
|
|
6
|
-
|
|
7
|
-
### Requirement: Configuration file storage
|
|
8
|
-
The system SHALL store configuration in a `.release-cherry-pick.json` file in the project root.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Create configuration file
|
|
11
|
-
- **WHEN** the configuration file does not exist
|
|
12
|
-
- **THEN** the system SHALL create it with default values and prompt the user for initial setup
|
|
13
|
-
|
|
14
|
-
#### Scenario: Load existing configuration
|
|
15
|
-
- **WHEN** the configuration file exists
|
|
16
|
-
- **THEN** the system SHALL load and validate the configuration before proceeding
|
|
17
|
-
|
|
18
|
-
### Requirement: Branch configuration
|
|
19
|
-
The system SHALL allow users to configure branch naming patterns.
|
|
20
|
-
|
|
21
|
-
#### Scenario: Configure branch prefix
|
|
22
|
-
- **WHEN** user configures branch prefix
|
|
23
|
-
- **THEN** the system SHALL store the prefix and use it when creating release branches
|
|
24
|
-
|
|
25
|
-
#### Scenario: Configure staging branch name
|
|
26
|
-
- **WHEN** user configures the staging branch name
|
|
27
|
-
- **THEN** the system SHALL use this as the base for creating release branches
|
|
28
|
-
|
|
29
|
-
### Requirement: GitLab provider configuration
|
|
30
|
-
The system SHALL store GitLab connection settings.
|
|
31
|
-
|
|
32
|
-
#### Scenario: Configure GitLab URL
|
|
33
|
-
- **WHEN** user provides GitLab instance URL
|
|
34
|
-
- **THEN** the system SHALL store the URL and validate connectivity
|
|
35
|
-
|
|
36
|
-
#### Scenario: Configure GitLab token
|
|
37
|
-
- **WHEN** user provides personal access token
|
|
38
|
-
- **THEN** the system SHALL store the token securely and validate permissions
|
|
39
|
-
|
|
40
|
-
### Requirement: AI provider configuration
|
|
41
|
-
The system SHALL optionally store AI provider settings for generating MR descriptions.
|
|
42
|
-
|
|
43
|
-
#### Scenario: Configure AI provider
|
|
44
|
-
- **WHEN** user enables AI description generation
|
|
45
|
-
- **THEN** the system SHALL store provider settings and API keys
|
|
46
|
-
|
|
47
|
-
### Requirement: Configuration validation
|
|
48
|
-
The system SHALL validate all configuration values before proceeding with operations.
|
|
49
|
-
|
|
50
|
-
#### Scenario: Validate required fields
|
|
51
|
-
- **WHEN** configuration is loaded
|
|
52
|
-
- **THEN** the system SHALL verify all required fields are present and valid
|