feat: archgate adr import — registry import command#296
Merged
Conversation
Deploying archgate-cli with
|
| Latest commit: |
5f1e6e7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9e60124c.archgate-cli.pages.dev |
| Branch Preview URL: | https://feature-adr-import.archgate-cli.pages.dev |
Implements the ADR import command (Phases A.2, C.1-C.7) enabling users to import curated ADR packs from the official registry, third-party GitHub repos, or any git URL. Includes source resolution, shallow cloning, ID remapping, atomic writes with rollback, and an imports.json manifest. - src/formats/pack.ts: Zod schemas for pack metadata, community links, and imports manifest - src/helpers/registry.ts: Source resolver (official/github/git-url) and shallow clone helper with deduplication - src/commands/adr/import.ts: Full command with --yes, --json, --dry-run, --prefix, and --list options - src/engine/rule-scanner.ts: scanImportedRuleSource() for stricter validation of untrusted imported rules - docs/: Guide and pt-br translation for importing ADRs - tests/: Unit tests for schemas, resolver, command registration, and integration tests with local fixtures Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
cdd62c9 to
a92204a
Compare
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
0b157e5 to
6d164da
Compare
Proto 0.56.4 cannot install Node 24 on Windows — the binary download completes but node.exe is never written to disk, causing postinstall to fail with proto::locate::missing_executable. This is a fresh-install bug, not a cache issue (verified by deleting all Windows caches). Pin to Node 22 (LTS) which installs correctly. Node is only used for the npm postinstall script; the CLI itself runs on Bun. Reported upstream: moonrepo/proto#1006 Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
archgate adr importcommand enabling import of curated ADR packs from the official registry (packs/<name>), third-party GitHub repos (org/repo/path), or any git URL@<ref>pinning, shallow clone deduplication, automatic ID remapping to project numbering, atomic writes with rollback on failure, and an.archgate/imports.jsonprovenance manifestrule-scanner.tswithscanImportedRuleSource()for stricter sandboxing of untrusted imported rules (blocksBun.env,process.env,require(),WebSocket)Changes
src/formats/pack.tssrc/helpers/registry.tsshallowClone()+detectTarget()src/commands/adr/import.tssrc/engine/rule-scanner.tsscanImportedRuleSource()stricter scannersrc/commands/adr/index.tsdocs/.../importing-adrs.mdxdocs/astro.config.mjs.oxlintrc.jsontests/Test plan
bun test— 800 pass, 0 failbun run validate— lint, typecheck, format, knip, archgate check, build all passarchgate adr import packs/typescript-strict --dry-runagainst live registry (requires network)