Skip to content

Add resources code export command#1384

Draft
thebiglabasky wants to merge 1 commit into
mainfrom
herve/resources-code-export-cli
Draft

Add resources code export command#1384
thebiglabasky wants to merge 1 commit into
mainfrom
herve/resources-code-export-cli

Conversation

@thebiglabasky

Copy link
Copy Markdown
Contributor

Summary

Adds checkly resources export as a read-only CLI command for exporting Checkly resources as Monitoring as Code constructs.

The command uses the planned public API endpoint POST /v1/resources/code-export instead of import-related code paths. It supports explicit type:id exports to stdout by default, bulk/filter exports to --output-dir, --code-managed-only, --updated-after, --updated-within, and warnings for resources that are not linked to the current MaC project.

Backend dependency

This CLI PR depends on the public API endpoint being implemented and live:

POST /v1/resources/code-export

Until that endpoint exists, the command is not releasable as working end-to-end.

Validation

  • node ./node_modules/eslint/bin/eslint.js packages/cli/src/commands/resources/export.ts packages/cli/src/rest/resources.ts packages/cli/src/rest/api.ts packages/cli/src/commands/__tests__/resources-export.spec.ts packages/cli/src/commands/__tests__/command-metadata.spec.ts packages/cli/src/rest/__tests__/resources.spec.ts
  • node ./node_modules/typescript/bin/tsc --build
  • node ./node_modules/vitest/vitest.mjs --run ./src/commands/__tests__/resources-export.spec.ts ./src/rest/__tests__/resources.spec.ts ./src/commands/__tests__/command-metadata.spec.ts
  • node ./node_modules/oclif/bin/run.js manifest
  • CHECKLY_SKIP_AUTH=1 node ./bin/run resources export --help

Note: the normal commit hook attempted pnpm install and hit the existing supply-chain policy failure for undici-types@6.21.0 (ERR_PNPM_TRUST_DOWNGRADE), so the commit was created with hooks bypassed after the focused checks above passed.

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