fix(ci): restore package-lock.json tracking and fix Nx lockfile detection#76
fix(ci): restore package-lock.json tracking and fix Nx lockfile detection#76ThePlenkov merged 20 commits intomainfrom
Conversation
|
View your CI Pipeline Execution ↗ for commit c7b856c
☁️ Nx Cloud last updated this comment at |
Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
…auth test Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
|
Note Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
Request timed out after 900000ms (requestId=dfa1e45d-9251-4633-910b-7a6178455b5c) |
…om .claude/.github/.windsurf
|
@copilot please fix CI |
…slint external dep resolution Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
…=npm to fix eslint dep resolution Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Fixed in c7b1ce8. The previous fix changed New approach: reverted Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR restores correct dependency/lockfile detection for Nx task hashing and expands the ADT toolchain with service-key OAuth auth support, AUnit schemas/contracts, and improved XSD import/ref resolution in ts-xsd.
Changes:
- Fix Nx external dependency graph stability by tracking
package-lock.json, ignoringbun.lock, and settingnx.jsoncli.packageManager: "npm". - Add BTP service-key (PKCE) authentication support and CLI integration, plus support for passing Bearer tokens through the ADT client adapter.
- Extend schema/codegen pipeline to better honor imported schemas and add/regen AUnit-related schemas, fixtures, and contract tests.
Reviewed changes
Copilot reviewed 58 out of 101 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ts-xsd/src/xsd/parse.ts | Adjust attribute copy helpers to check explicit attribute presence |
| packages/ts-xsd/src/xml/build.ts | Fix namespace qualification by using defining schema’s elementFormDefault first |
| packages/ts-xsd/src/generators/raw-schema.ts | Add singleQuote option and propagate through literal generation |
| packages/ts-xsd/src/generators/interfaces.ts | Preserve $imports refs during resolution to support cross-schema element refs |
| packages/ts-xsd/src/codegen/ts-morph.ts | Resolve element.ref across $imports for imported schemas |
| packages/ts-xsd/src/codegen/generate.ts | Add singleQuote option and propagate through literal generation |
| packages/browser-auth/src/types.ts | Add loginUrl option for SSO navigation target customization |
| packages/browser-auth/src/auth-core.ts | Support loginUrl and broaden cookie-detection to SAP-domain responses |
| packages/adt-schemas/ts-xsd.config.ts | Add new custom schemas + enable single-quote generation |
| packages/adt-schemas/src/schemas/generated/types/sap/transportmanagment.types.ts | Regenerated types (now includes link structures) |
| packages/adt-schemas/src/schemas/generated/types/sap/traces.types.ts | Regenerated types (more specific uriMapping) |
| packages/adt-schemas/src/schemas/generated/types/sap/quickfixes.types.ts | Regenerated types (more specific object refs/links) |
| packages/adt-schemas/src/schemas/generated/types/sap/logpoint.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/log.types.ts | Regenerated types (adds multiple link nodes) |
| packages/adt-schemas/src/schemas/generated/types/sap/configurations.types.ts | Regenerated types (replaces unknown with explicit structure) |
| packages/adt-schemas/src/schemas/generated/types/sap/configuration.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/checkrun.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/checklist.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/atcworklist.types.ts | Regenerated types (adds scaAttributes/descriptionTags) |
| packages/adt-schemas/src/schemas/generated/types/sap/atcresult.types.ts | Regenerated types (adds scaAttributes/descriptionTags + queryChoice shape) |
| packages/adt-schemas/src/schemas/generated/types/sap/atcfinding.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/atcexemption.types.ts | Regenerated types (adds reasons/validities) |
| packages/adt-schemas/src/schemas/generated/types/sap/adtcore.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/sap/abapsource.types.ts | Regenerated types (adds link blocks) |
| packages/adt-schemas/src/schemas/generated/types/custom/transportmanagmentSingle.types.ts | Regenerated types (adds link blocks) |
| packages/adt-schemas/src/schemas/generated/types/custom/http.types.ts | Regenerated types (adds link) |
| packages/adt-schemas/src/schemas/generated/types/custom/discovery.types.ts | Regenerated types (adds more fields) |
| packages/adt-schemas/src/schemas/generated/types/custom/aunitRun.types.ts | New generated AUnit run-config types |
| packages/adt-schemas/src/schemas/generated/types/custom/aunitResult.types.ts | New generated AUnit run-result types |
| packages/adt-schemas/src/schemas/generated/types/custom/atcRun.types.ts | Regenerated types (adds objectReferences wrapper) |
| packages/adt-schemas/src/schemas/generated/types/custom/adtcoreObjectSets.types.ts | New generated extension types for missing ADT core objectSets |
| packages/adt-schemas/src/schemas/generated/typed.ts | Register typed schemas for AUnit run/result |
| packages/adt-schemas/src/schemas/generated/schemas/sap/atcworklist.ts | Import atc + add scaAttributes element |
| packages/adt-schemas/src/schemas/generated/schemas/sap/atcresult.ts | Import atc + add scaAttributes element |
| packages/adt-schemas/src/schemas/generated/schemas/sap/atcexemption.ts | Import atc + add reasons/validities elements |
| packages/adt-schemas/src/schemas/generated/schemas/custom/index.ts | Export new custom schemas |
| packages/adt-schemas/src/schemas/generated/schemas/custom/aunitRun.ts | New generated AUnit run schema literal |
| packages/adt-schemas/src/schemas/generated/schemas/custom/aunitResult.ts | New generated AUnit result schema literal |
| packages/adt-schemas/src/schemas/generated/schemas/custom/adtcoreObjectSets.ts | New generated extension schema literal for objectSets |
| packages/adt-schemas/project.json | Run prettier after codegen |
| packages/adt-schemas/AGENTS.md | Clarify XSD lifecycle rules (downloaded vs custom vs generated) |
| packages/adt-schemas/.xsd/custom/aunitRun.xsd | New custom XSD for AUnit run configuration |
| packages/adt-schemas/.xsd/custom/aunitResult.xsd | New custom XSD for AUnit result response |
| packages/adt-schemas/.xsd/custom/adtcoreObjectSets.xsd | New custom XSD extending ADT core objectSets types |
| packages/adt-playwright/src/index.ts | Ensure destination-specific options override global options |
| packages/adt-fixtures/src/fixtures/registry.ts | Add AUnit fixtures |
| packages/adt-fixtures/src/fixtures/aunit/run-result.xml | New AUnit run-result fixture |
| packages/adt-fixtures/src/fixtures/aunit/run-request.xml | New AUnit run-request fixture |
| packages/adt-contracts/tests/contracts/aunit.test.ts | New AUnit contract + fixture parsing tests |
| packages/adt-contracts/src/generated/schemas.ts | Expose AUnit schemas to contracts |
| packages/adt-contracts/src/adt/repository/informationsystem/search.ts | Add package/objectType filters + set XML Accept header |
| packages/adt-contracts/src/adt/index.ts | Export and register AUnit contract |
| packages/adt-contracts/src/adt/core/http/systeminformation.ts | Use SAP-specific vendor JSON Accept header |
| packages/adt-contracts/src/adt/aunit/index.ts | New AUnit endpoint contract |
| packages/adt-config/src/config-loader.ts | Change string destination shorthand to default to basic auth plugin |
| packages/adt-client/src/types.ts | Add authorizationHeader to connection config |
| packages/adt-client/src/adapter.ts | Prefer explicit Authorization header over basic auth |
| packages/adt-cli/tsdown.config.ts | Remove forced bundling config |
| packages/adt-cli/src/lib/utils/adt-client-v2.ts | Support bearer token stored in cookie creds with Authorization: prefix |
| packages/adt-cli/src/lib/services/import/service.ts | Build ADK objects and route through format import + hooks/context |
| packages/adt-cli/src/lib/commands/import/package.ts | Change default format and output directory |
| packages/adt-cli/src/lib/commands/auth/login.ts | Prompt for basic auth creds when missing in config |
| packages/adt-cli/src/lib/cli.ts | Add --service-key auto-authentication flow |
| packages/adt-cli/src/lib/auth-utils.ts | Expand service-key types/validation adjustments |
| packages/adt-auth/tsdown.config.ts | Add build entries for service-key plugin and env utilities |
| packages/adt-auth/src/utils/env.ts | Add env/file-based service-key resolution helpers |
| packages/adt-auth/src/plugins/service-key.ts | New BTP service-key PKCE auth plugin |
| packages/adt-auth/src/index.ts | Export service-key plugin + env utilities + service-key types |
| packages/adt-auth/package.json | Export new plugin and utility entrypoints |
| packages/adt-aunit/tsdown.config.ts | New build configuration for AUnit plugin |
| packages/adt-aunit/tsconfig.json | New TS config for AUnit package |
| packages/adt-aunit/src/types.ts | New normalized AUnit result model |
| packages/adt-aunit/src/index.ts | New public exports for AUnit plugin |
| packages/adt-aunit/src/formatters/junit.ts | New JUnit XML output formatter |
| packages/adt-aunit/src/formatters/index.ts | Export formatter helpers |
| packages/adt-aunit/src/commands/aunit.ts | New adt aunit command implementation |
| packages/adt-aunit/project.json | New Nx project definition |
| packages/adt-aunit/package.json | New package manifest + exports |
| packages/adk/src/objects/repository/devc/devc.model.ts | Implement package subpackage/object discovery via repository search |
| package.json | Add workspace packages to root devDependencies |
| nx.json | Set Nx CLI package manager to npm |
| adt.config.ts | Register AUnit command plugin |
| AGENTS.md | Add file lifecycle guidance |
| .windsurf/skills | Add skills pointer file (environment-specific path) |
| .gitignore | Ignore .adt and bun.lock |
| .github/workflows/ci.yml | Restrict push workflow to main only |
| .github/skills/add-object-type/SKILL.md | Formatting/markdown table cleanup |
| .github/skills/add-endpoint/SKILL.md | Formatting/markdown table cleanup |
| .github/skills | Add skills pointer file (environment-specific path) |
| .claude/skills | Add skills pointer file (environment-specific path) |
Comments suppressed due to low confidence (8)
packages/browser-auth/src/auth-core.ts:1
- new URL(event.url)` can throw if the adapter emits non-absolute URLs (e.g., about:blank, data:, or relative URLs). Wrap the URL parsing in a try/catch (or guard on a valid http/https prefix) to avoid crashing the auth flow on unrelated responses.
packages/adt-cli/src/lib/services/import/service.ts:1 - adkObject
is checked for falsiness only after callingload(). Iffactory.get(...)returnsundefinedfor an unknown type, this will throw before the skip logic runs. Move the null/undefined check before invokingload()`.
packages/adt-cli/src/lib/services/import/service.ts:1 - The dynamic import of '@abapify/adk' happens inside the per-object loop, adding avoidable overhead for large imports. Import (or dynamically import) once before iterating, then reuse the factory for all objects.
packages/adt-auth/src/utils/env.ts:1 - The PR description mentions supporting both ADT_SERVICE_KEY and COPILOT_ADT_SERVICE_KEY, but the implementation only checks ADT_SERVICE_KEY. Consider checking COPILOT_ADT_SERVICE_KEY as a fallback (or updating the docs/description if that’s no longer intended).
packages/adt-auth/src/plugins/service-key.ts:1 - This encodes a Bearer token into a field named "cookies" and returns it as method "cookie", which is semantically misleading and makes downstream handling brittle (it already requires special-casing in adt-client-v2). Prefer introducing an explicit auth method/credential shape for Bearer tokens (e.g., method: 'bearer' with { authorizationHeader, expiresAt }) so consumers don’t need to parse a magic prefix string. Also ensure the type of expiresAt matches the declared CookieCredentials shape (commonly string/ISO rather than Date) to avoid runtime serialization issues in storage.
packages/adt-client/src/adapter.ts:1 - If neither SAML (
cookieHeader) norauthorizationHeaderis provided, this constructs a Basic auth header even whenusername/passwordare undefined (producing a header for "undefined:undefined"). Only emit the Basic header when both username and password are set.
packages/adt-schemas/project.json:1 - Chaining
cd ../..inside the command is brittle (especially across shells/Windows) and makes the working directory implicit. Prefer configuring the working directory for a separate command step (e.g., Nx run-commands array) or invoking prettier with an explicit--config/paths without relying oncd.
.windsurf/skills:1 - This file contains an absolute, machine-specific path that will not exist for other contributors and may leak local environment details. Prefer removing it from the repo or replacing it with a relative path/documented configuration that works across environments. (Same concern applies to similar pointer files in .github/skills and .claude/skills.)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
These changes fix three categories of lint/test failures introduced by the PR. We removed redundant type annotations in ts-xsd, updated the test expectation to match the intentional Accept header change, and converted static imports of the lazy-loaded adk library to use import type for types and dynamic imports for runtime values, preserving the workspace's module boundary architecture.
Tip
✅ We verified this fix by re-running ts-xsd:lint.
Warning
The suggested diff is too large to display here, but you can view it on Nx Cloud ↗
Or Apply changes locally with:
npx nx-cloud apply-locally JjZW-ja4W
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
|
@copilot please fix ci |
…dt-contracts test header Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>
Fixed in c7b856c. Three tasks were failing:
|
|
- Use node: prefix imports in service-key.ts, env.ts, aunit.ts, junit.ts - Fix nested template literals in service-key.ts, adapter.ts, aunit.ts, junit.ts - Replace String#replace() with String#replaceAll() in junit.ts, generate.ts, raw-schema.ts - Use String.raw for backslash escaping in generate.ts, raw-schema.ts - Replace parseFloat with Number.parseFloat in aunit.ts - Combine multiple Array#push() calls in junit.ts - Fix nested function depth (S2004) in service-key.ts - Reduce cognitive complexity in aunit.ts (extract convertAlerts, resolveTargets, displayFailedMethod, displaySummary) - Reduce cognitive complexity in junit.ts (extract buildTestCaseXml) - Reduce cognitive complexity in generate.ts and raw-schema.ts (extract toSingleQuoteLiteral) - Reduce cognitive complexity in ts-morph.ts (extract resolveElementType, findRefElement) - Mark 8 encrypt-data security hotspots in generated XSD schema files as Safe (XML namespace URIs) - Add sonar-project.properties to exclude generated schema files from duplication detection Co-authored-by: ThePlenkov <6381507+ThePlenkov@users.noreply.github.com>


ts-xsd:lint,adt-cli:lint,adt-contracts:test: booleantype annotations from default params inraw-schema.tsandgenerate.ts(violated@typescript-eslint/no-inferrable-types)await import('@abapify/adk')inservice.tsto static import — Nx@nx/enforce-module-boundariesflags ALL static imports of a library as forbidden when ANY dynamic import of it exists in the same projectAcceptheader incore.test.ts— test expectedapplication/jsonbut the contract (correctly) usesapplication/vnd.sap.adt.core.http.systeminformation.v1+jsonts-xsd:lint(0 errors),adt-cli:lint(0 errors),adt-contracts:test(192/192 passing)Original prompt
Context
This is issue #71, part of epic #70: restoring BTP service key authentication to the
adt-climonorepo.The repo is a Nx monorepo using Bun. The auth system in
@abapify/adt-authuses a plugin architecture where each auth method is a separate plugin implementingAuthPlugininterface with adefaultexport.Goal
Implement a new
service-keyauth plugin insidepackages/adt-auththat authenticates against SAP BTP using a service key JSON. This involves migrating existing code frompackages/adt-cli/src/lib/auth-utils.tsandpackages/adt-cli/src/lib/oauth-utils.tsintopackages/adt-auth.Also implement a utility
resolveServiceKeyFromEnv()that readsADT_SERVICE_KEYorCOPILOT_ADT_SERVICE_KEYenv vars and returns a readyDestinationconfig for the service-key plugin (this covers issues #71 and #72 together as they are tightly coupled).Existing Code to Migrate
packages/adt-cli/src/lib/auth-utils.ts(migrate →packages/adt-auth/src/types/service-key.ts)packages/adt-cli/src/lib/oauth-utils.ts(migrate →packages/adt-auth/src/utils/pkce.ts)Reference: Existing
basicPlugin PatternReference:
AuthPluginTypes