Skip to content

test: cover PR #377 preflight refactors and standards CI script#384

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/missing-test-coverage-a3e1
Draft

test: cover PR #377 preflight refactors and standards CI script#384
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/missing-test-coverage-a3e1

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds focused regression tests for production changes in PR #377 (chore: add automated coding standards enforcement) that lacked direct behavioral coverage.

Risky behavior now covered

Area Risk What the tests lock in
scripts/check-standards.js CI gate silently breaks or drifts from repo Script exits 0 on compliant codebase; wired to standards:check
cost_perspective.create preflight Wrong CCM defaults merged into new perspectives Settings API fetch, agent-wins merge, graceful degradation on failure
idp_workflow.execute bodyBuilder API keys leaked to stderr logs Secrets reach wire payload but are [REDACTED] in debug logs
STO exemption create/approve/reject Wrong user ID on write operations getCurrentUserId() via HarnessClientInterface (no HarnessClient cast)

Test files added

  • tests/coding-standards/check-standards-script.test.ts — CI script smoke test
  • tests/registry/ccm-perspective-preflight.test.ts — CCM settings merge preflight
  • tests/registry/idp-workflow-execute.test.ts — IDP auth injection + log redaction
  • tests/registry/sto-exemption-user-id.test.ts — STO user-ID derivation on create/approve/reject

Why this reduces regression risk

PR #377 refactored preflight hooks to use the structural HarnessClientInterface instead of casting to HarnessClient, and moved IDP debug logging from raw console.error to createLogger with explicit redaction. These are high-blast-radius paths (cost perspective defaults, secret handling, exemption approvals) where a regression would either corrupt data or leak credentials. The new tests exercise the refactored code paths with minimal mocks that match the new interface contract.

Validation

pnpm test  # 2121 passed (89 files)
Open in Web View Automation 

cursoragent and others added 4 commits June 22, 2026 10:03
…ctFn path

Add regression tests for recent production fixes where coverage was thin:

- GitOps supportedScopes: lock account/org/project declaration on the four
  scopeOptional resources fixed in #342 and verify account-scope list dispatch
  omits org/project params; contrast with gitops_application fallback behavior
- hasRequiredDiscoveryScope: direct unit tests for account/org/project gating
  used by execution-summary and pipeline-yaml resources (#325)
- HarnessClient: include config-service in x-tenant-id gRPC-proxy coverage (#361)
- compactItems: test custom compactFn delegation and openInHarness merge

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
… pipeline-yaml edges

Add regression tests for recently merged production paths with thin coverage:

- HarnessClient: append API description field on /chaos/ and /loadTest/ errors
  for both request() and requestStream(); verify non-matching paths stay unchanged;
  extend requestStream x-tenant-id coverage to schema-service and config-service
- templateV1BasePathFromScope: explicit account/org/project paths, legacy inference,
  validation errors, and URL encoding
- pipeline-yaml resource: scopeOptional bypass and pipeline_v1 discovery when
  HARNESS_PIPELINE_VERSION is v1

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
- Add docs/coding-standards.md as the canonical architecture guide
- Add scripts/check-standards.js and tests/coding-standards/architecture.test.ts
- Wire pnpm standards:check into CI alongside build/test/typecheck
- Fix ToolsetName union missing knowledge-graph and semantic-layer
- Remove HarnessClient imports from sto/ccm toolsets (use narrow interfaces)
- Replace idp console.error with structured createLogger

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Add focused regression tests for production changes in the coding-standards
PR that lacked direct coverage:

- check-standards.js CI script smoke test
- CCM cost_perspective.create settings merge preflight via HarnessClientInterface
- IDP workflow execute secret redaction and auth token injection
- STO exemption create/approve/reject getCurrentUserId() via structural client

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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