Skip to content

feat: GitLab module-CI (shared core + GitLab template) - #20

Merged
SatyendraGollaFacets merged 3 commits into
masterfrom
feat/gitlab-module-ci
Oct 22, 2026
Merged

SatyendraGollaFacets merged 3 commits into
masterfrom
feat/gitlab-module-ci

Conversation

@SatyendraGollaFacets

Copy link
Copy Markdown
Contributor

What

The GitLab counterpart of module-ci-action, plus a shared core so the two hosts never drift.

  • module-ci-core.sh (new) — host-neutral logic (install raptor/tf/trivy, detect changed modules/outputs, preview/publish/cleanup, markdown), driven by a generic MC_* env contract.
  • module-ci-action/action.yml — refactored (−675 lines) to resolve mode + map the GitHub event to the contract, then call the shared core. Behaviour-preserving.
  • module-ci-gitlab/ (new) — the GitLab CI template: thin glue mapping GitLab's CI vars to the contract, fetching + running the core, posting the MR preview note. README included.

Tested

  • module-ci-core.sh shellcheck-clean; action.yml parses + every embedded script shellcheck-clean (the repo's CI bar).
  • All 4 modes proven live against a real control plane: preview (validate + register), publish (upload + compat declaration + publish), cleanup (ownership-checked delete), failure gating.
  • Full gitlab.com pipeline proven: a real pipeline fetched the core and published a module to a real CP.

Notes for review

  • This touches the production module-ci-action — a behaviour-preserving refactor to share the core (verified against pr.json/push.json + shellcheck).
  • A test workflow .github/workflows/test-module-ci-gitlab.yaml couldn't be pushed from my token (missing workflow scope); needs adding by someone with scope.
  • Open question: GitLab consumes the template via include: remote: (raw GitHub URL, pinned v1). OK, or prefer a Docker image?
  • Cleanup-on-close is deferred — GitLab runs no pipeline when an MR is closed.

🤖 Generated with Claude Code

SatyendraGollaFacets and others added 3 commits October 15, 2026 17:06
Extracts the raptor-driving logic from module-ci-action into a shared script
both GitHub and GitLab call, driven by a generic env contract (MODE,
CI_DIFF_RANGE, CI_HEAD_SHA, CI_OWNER_SHAS, PATH_PREFIX, raptor creds). No logic
duplicated across hosts. Install-if-missing so it runs in CI and locally.

shellcheck-clean. Verified live against facetsdemo: preview (validate+register),
publish (upload+compat-declaration+publish), cleanup (ownership-checked delete),
and failure gating all pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 776-line inlined action is now thin glue: resolve mode + map the GitHub
event to the generic env contract, resolve PR commit SHAs for cleanup, run the
shared core, and post the PR preview comment (if: always() so a gated failure
still comments). All raptor-driving logic lives in module-ci-core.sh.

action.yml parses + every embedded script is shellcheck-clean (the repo's CI bar).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…oot-safety

- module-ci-gitlab/template.gitlab-ci.yml: thin GitLab glue mapping GitLab CI
  vars to the generic MC_* contract, fetching + running the shared core, posting
  the MR preview note in after_script (runs even when the core gates). Preview +
  publish supported; cleanup-on-close deferred (GitLab runs no pipeline on MR close).
- Rename the generic contract vars CI_* -> MC_* (CI_ is GitLab's reserved prefix).
- Core install is root-safe (GitLab containers run as root without sudo).
- README + test workflow (YAML parse + shellcheck), mirroring module-ci-action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SatyendraGollaFacets
SatyendraGollaFacets merged commit fc3e9c6 into master Oct 22, 2026
1 check passed
@SatyendraGollaFacets
SatyendraGollaFacets deleted the feat/gitlab-module-ci branch October 22, 2026 11:50
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