-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ATC checks implementation for CI pipeline #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add @abapify/adt-plugin-atc package - Define types for ATC checks, findings, variants - Stub plugin implementation - Configure build with tsdown
ATC functionality will be implemented directly in adt-cli commands, no need for a separate plugin package.
refactor(adk,adt-cli): unwrap root schema elements and improve type safety BREAKING CHANGE: ADK object types now use unwrapped schema elements instead of full response types ADK Changes: - Unwrap root elements from schema responses (abapClass, package, abapInterface, etc.) - Update type definitions to extract inner types (ClassXml = ClassResponse['abapClass']) - Add explicit response unwrapping in load() methods across all objects - Fix AdkObjectConstructor to use explicit any type for name
refactor(adt-contracts,adt-codegen): migrate from relative imports to tsconfig path aliases - Update tsdown from 0.16.7 to 0.18.1 (supports path alias resolution in .d.ts files) - Replace package self-references with #base and #schemas path aliases - Update defaultResolveImports() to use aliases instead of calculating relative paths - Regenerate all contract files with new import style - Add generated contracts directory to ESLint ignores (intentionally uses package imports) - Rename project
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
feat(adt-codegen): add endpoint-level method filtering and clean option - Add endpoint-config module with defineEndpoint/defineEndpoints helpers - Support method filtering per endpoint (GET, POST, PUT, DELETE, etc.) - Add EndpointDefinition type for type-safe endpoint configuration - Support both string patterns and config objects in enabled endpoints - Add clean option to remove output directory before generation - Export endpoint configuration API from package index - Update enabled-endpoints.ts to use new
refactor(adt-contracts,adt-cli,adt-client,adt-codegen)!: remove /atc/runs endpoint and improve contract testing BREAKING CHANGE: /sap/bc/adt/atc/runs endpoint removed from generated contracts (not in SAP discovery data) ATC Changes: - Remove runsContract from generated contracts (endpoint not in discovery) - Update enabled-endpoints.ts with note about manual addition if needed - Fix atc.ts command to not wrap data in 'run' root element (buildXml adds it automatically) - Rewrite atc.test.ts to use generated contracts (
refactor(ts-xsd,adt-fixtures)!: change root type to match parse() behavior and update ATC fixtures
BREAKING CHANGE: Root schema types now represent element content directly instead of wrapping in element name object
ts-xsd Changes:
- Update generateRootType() to use element's content type directly (matches parse() return value)
- Remove element name wrapper from root types (was `{ elementName: Type }`, now just `Type`)
- Update all test assertions to expect unwrapped root types
- Add typecheck
refactor(adt-schemas)!: expand schema union types and add test typecheck task BREAKING CHANGE: Schema types now include all possible root elements as union types instead of single element types - Add typecheck:test task to project.json for test file type checking - Expand atomExtended schema to include category and link elements - Expand templatelinkExtended schema to include templateLink element - Remove abapoo.types.ts (consolidated into other schemas) - Add union types for syntaxConfiguration,
refactor(adt-contracts): combine generated and manual ATC contracts - Add build, test, and typecheck:test tasks to project.json - Restructure ATC contracts to use generated contracts as base - Add manual endpoints for customizing, runs POST, and worklists.create (not in SAP discovery) - Re-export generated resultsContract and worklistsContract - Merge manual worklistsExtended with generated worklistsContract - Add documentation explaining generated vs manual endpoint sources ```
refactor(adt-cli,adt-atc)!: extract ATC command to separate plugin package BREAKING CHANGE: ATC command moved from adt-cli to @abapify/adt-atc plugin package - Move atc.ts command implementation to @abapify/adt-atc package - Remove ATC formatters (gitlab-formatter.ts, sarif-formatter.ts) from adt-cli - Add @abapify/adt-codegen and @abapify/adt-atc as dependencies to adt-cli - Update root adt.config.ts to load both codegen and atc command plugins - Add config files (*.config.ts, *.config.mts
…st results - Update status from BROKEN to WORKING after successful transport import - Document successful import of 5 objects (2 CLAS, 2 DEVC, 1 INTF) - Note 9 objects skipped due to unsupported types - Add CLI output example showing successful import - Clarify that build errors in adt-cli don't block import functionality - Mark previous plugin API mismatch issue as RESOLVED
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||||||||||||||||||||
Findings Acknowledged ✅Thanks for the automated review! Applied Fixes:
Not Applied (Architectural Decisions):
Reviewed by: @pplenkov |
User description
Overview
Implements ATC (ABAP Test Cockpit) checks integration for the CI/CD pipeline.
Context
This is the next step after the abapgit import milestone. ATC checks will enable:
Tasks
Related
Part of the ABAP Code Review CI/CD pipeline implementation.
PR Type
Enhancement, Tests, Bug fix
Description
ATC (ABAP Test Cockpit) integration: Implements ATC checks service with command plugin for running static code analysis, creating worklists, and outputting results in multiple formats (console, JSON, GitLab, SARIF)
Generic save/load/lock operations: Adds base model methods for CRUD operations using contracts, lock/unlock lifecycle, and source code management with mode switching (create/update/upsert)
CRUD contract helper: Provides reusable helper for generating full CRUD contracts for ADT repository objects with support for lock/unlock, source code, and includes endpoints
Contract generation from discovery: Implements discovery parser and contract generator plugin to create type-safe ADT contracts from SAP discovery data with whitelist-based filtering
Plugin-based CLI architecture: Refactors CLI to dynamically load commands from configuration files, enabling extensibility without hardcoded command dependencies
abapGit deserialization: Implements bidirectional serialization for ABAP objects (CLAS, INTF, DEVC) with file-to-ADK object conversion and metadata mapping
XML parsing improvements: Enhances XML builder with namespace prefix resolution, attribute reference handling, and wrapped element format support for type discrimination
Object set bulk operations: Adds semantic layer for managing collections of ADK objects with bulk save, activate, deploy, and lock operations
Export/deploy command: Implements file deployment plugin supporting multiple format plugins (abapgit, oat) with dry-run mode and progress reporting
Error handling: Adds structured ADT error handling with exception parsing from SAP responses
Transport service: Implements CTS transport operations service layer for listing, getting, and deleting transports
Test framework enhancements: Adds typed contract scenario framework, mock HTTP adapter, and comprehensive test coverage for XML parsing, schema validation, and contract operations
Bug fixes: Fixes browser auth cookie clearing, transport response unwrapping, and property access issues
Diagram Walkthrough
File Walkthrough
29 files
generate-contracts.ts
Contract generator plugin for ADT discovery datapackages/adt-codegen/src/plugins/generate-contracts.ts
from discovery data
mapping
individual methods
model.ts
Generic save/load/lock operations with CRUD contractspackages/adk/src/base/model.ts
SaveMode,SaveOptions, andActivationResulttypes for saveoperations
load()method using CRUD contracts and wrapperkeys
collectionUriproperty for creating new objectssave()method with lock/unlock lifecycle and modeswitching (create/update/upsert)
lock()andunlock()methods using CRUD contracts with lockresponse parsing
setSource()andactivate()methods for source code andactivation operations
crud.ts
CRUD contract helper for ADT repository objectspackages/adt-contracts/src/helpers/crud.ts
objects
parameters
definitions, implementations)
repo()shorthand alias for common CRUD patternsatc.ts
ATC command plugin for ABAP Test Cockpit checkspackages/adt-atc/src/commands/atc.ts
clas.model.ts
Simplify class model with generic save/load operationspackages/adk/src/objects/repository/clas/clas.model.ts
base class methods
load()to use generic base implementation with CRUD contractssaveMainSource()andsaveIncludeSource()methods for source codepersistence
savePendingSources()override for abapGit deserializationworkflow
wrapperKeyandcrudContractproperties
datapropertyintf.model.ts
Simplify interface model with generic save/load operationspackages/adk/src/objects/repository/intf/intf.model.ts
load()to use generic base implementation with CRUD contractssaveMainSource()method for source code persistencesavePendingSources()override for abapGit deserializationworkflow
wrapperKeyandcrudContractproperties
datapropertyobject-set.ts
ADK Object Set bulk operations service implementationpackages/adk/src/base/object-set.ts
AdkObjectSetclass providing semantic layer for bulk operations oncollections of ADK objects
add,addAll,remove,clear,getAll,filterByType,filterByKind)saveAll(),activateAll(),deploy(),lockAll(),unlockAll(),loadAll()from()andfromGenerator()forcreating object sets from various sources
export.ts
Export command plugin for file deployment to SAPpackages/adt-export/src/commands/export.ts
systems
shortcut resolution
AdkObjectSetfor bulk save and activation operationswith detailed result display
build.ts
XML builder namespace and form attribute handling improvementspackages/ts-xsd/src/xml/build.ts
getPrefixForSchema()helper to resolve namespace prefixes forschema targetNamespaces
parse()with automatic unwrappingformattribute support and schema-aware prefix resolution
SAP ADT compatibility)
buildFieldWithTagName()to handle element-level formoverrides and qualified/unqualified attribute forms
classes.ts
Classes contract refactored to use crud() helperpackages/adt-contracts/src/adt/oo/classes.ts
crud()helper usageClassIncludeTypeto includetestclassesandlocaltypesinaddition to existing types
crud()helper and list allsupported operations (CRUD, lock/unlock, source, includes)
maintaining full functionality
deserializer.ts
abapGit deserializer for file-to-ADK object conversionpackages/adt-plugin-abapgit/src/lib/deserializer.ts
objects using async generator pattern
parseAbapGitFilename()to extract object metadata from filenaming conventions
deserialize()generator that yieldsAdkObjectinstances withpre-loaded data and sources
transformation
base.ts
Handler base types extended for bidirectional serializationpackages/adt-plugin-abapgit/src/lib/handlers/base.ts
InferAdkDatatype helper to extract data type fromAdkObject
D>genericsEnhanced
ObjectHandlerinterface withschema,suffixToSourceKey,fromAbapGit(), andsetSources()membersAdded
ObjectPayloadinterface for deserialization context with name,description, sources, and additional data
Extended
HandlerDefinitioninterface withfromAbapGit(),suffixToSourceKey, andsetSources()for bidirectional serializationUpdatedcreateHandler()to populate handler with schema anddeserialization methods
endpoint-config.ts
Endpoint configuration API for contract generationpackages/adt-codegen/src/plugins/endpoint-config.ts
defineEndpoint()anddefineEndpoints()helpersobjects with method filtering, schema override, and CRUD generation
isEndpointConfig(),normalizeEndpoint(),matchesPattern(),findMatchingEndpoint(),isPathEnabled(),isMethodEnabled()typed-scenario.ts
Typed contract scenario framework for type-safe testingpackages/adt-contracts/tests/contracts/base/typed-scenario.ts
full type safety
TypedContractScenarioabstract base class with typedassertRequest()andassertResponse()methodsExtractDescriptor,ExtractRequest,ExtractResponse,ExtractBodyfor inferring types from contractoperations
runTypedScenario()function with mock adapter integrationfor fully-typed client call testing
clas.ts
Class handler bidirectional serialization with metadata mappingpackages/adt-plugin-abapgit/src/lib/handlers/objects/clas.ts
SUFFIX_TO_SOURCE_KEYreverse mapping for deserialization (Git →SAP)
VISIBILITY_TO_EXPOSUREandEXPOSURE_TO_VISIBILITYmappings forvisibility enum conversion
toAbapGit()to map comprehensive class metadata (category,visibility, final, abstract, references, language version)
fromAbapGit()for deserializing abapGit values to ADKclass data with proper enum conversions
setSources()to store source files as pending duringdeserialization
cli.ts
CLI refactored to use plugin-based command loadingpackages/adt-cli/src/lib/cli.ts
loadCommandPlugins()todynamically load commands from
adt.config.tsconfig file
atcCommand,exportPackageCommand, anddeployCommandauth-manager.ts
Auth manager plugin options extended with URL and clientpackages/adt-auth/src/auth-manager.ts
urlandclientproperties topluginOptionsin session authconfiguration
context
transports.ts
Transport service layer for CTS operationspackages/adt-client/src/services/transports.ts
TransportServiceclass for orchestrating CTS transportoperations
transformation
data
implemented)
index.ts
ATC contract with manual and generated endpointspackages/adt-contracts/src/adt/atc/index.ts
in discovery
customizingcontract for GET ATC customizing settingsrunscontract with POST endpoint for executing ATC checksworklistsExtendedcontract with POST create endpoint for newworklists
plugin-loader.ts
CLI plugin loader for dynamic command registrationpackages/adt-cli/src/lib/plugin-loader.ts
loadCliConfig()to find and loadadt.config.tsfrom projecthierarchy
pluginToCommand()for translating plugin options/arguments toCommander format
traces.types.ts
Extended traces schema types with new variantspackages/adt-schemas/src/schemas/generated/types/sap/traces.types.ts
TracesSchematype with additional union variants foractivation, traces, trace, and records
records, and trace properties
metadata
cli-types.ts
CLI plugin type definitions and interfacespackages/adt-plugin/src/cli-types.ts
CliCommandPlugin,CliOption,CliArgumentCliContextwith logger, config, and ADT client factoryAdtCliConfigfor command plugin configurationcontracts.ts
Contracts command plugin for discovery-based generationpackages/adt-codegen/src/commands/contracts.ts
contractsCommandplugin for generating type-safe contractsfrom ADT discovery
missing settings
fetch
index.ts
Contract testing framework using speci typespackages/adt-contracts/tests/contracts/base/index.ts
RestEndpointDescriptorContractDescriptortype in favor of speci typesassertions
createClientand mock adapter utilities for contract testsindex.ts
Attribute reference resolution in schema walkerpackages/ts-xsd/src/walker/index.ts
schemafield toAttributeEntryfor namespace prefix resolutionresolveAttribute()function to handle attribute referencesfindAttribute()function to search attributes across schemahierarchy
interfaces.ts
Interfaces contract using crud helperpackages/adt-contracts/src/adt/oo/interfaces.ts
crud()helper with sources optiondefinitions
sourcesconfigurationdiscovery-parser.ts
Discovery XML parser for contract generationpackages/adt-codegen/src/plugins/discovery-parser.ts
DiscoveryDataformatgetAllCollections()helper to flatten collections acrossworkspaces
fast-xml-parserfor robust XML parsing with namespace handlingfiletree.ts
FileTree implementations for file operationspackages/adt-export/src/utils/filetree.ts
FsFileTreefor file system backed file operationsMemoryFileTreefor in-memory testingpackages.ts
Generated packages contract with multiple endpointspackages/adt-contracts/src/generated/adt/sap/bc/adt/packages.ts
/sap/bc/adt/packagesversion
packagesV1schema for response typing17 files
xml-parse.test.ts
Update XML parse tests for wrapped element formatpackages/ts-xsd/tests/unit/xml-parse.test.ts
results in element name
root element wrapper
{ Person:{ name: 'John' } })mock-e2e.test.ts
Update mock plugins to new serialization APIpackages/adt-cli/src/lib/plugins/mock-e2e.test.ts
serializeObjectmethod instead ofdeprecated
serializeSerializationContextdeserializemethod implementations from mock pluginsxml-build.test.ts
XML builder tests for namespaced types and inheritancepackages/ts-xsd/tests/unit/xml-build.test.ts
building
from imported schemas, and deeply nested structures
compatibility (no self-closing root elements)
derived schemas
tm.test.ts
Transport management schema tests updated for wrapped parse formatpackages/adt-schemas/tests/scenarios/tm.test.ts
parse()(data wrapped with element name)
rootproperty instead ofdirect access
overridekeyword tovalidateBuilt()methods for consistencyxml-cross-schema.test.ts
Cross-schema XML tests updated for wrapped parse formatpackages/ts-xsd/tests/unit/xml-cross-schema.test.ts
parse()(element name as wrapper key)element name wrapper (e.g.,
result.Object.idinstead ofresult.id)deep schema chains
atc.test.ts
ATC contract tests refactored to use generated contractspackages/adt-contracts/tests/contracts/atc.test.ts
src/generated/adt/sap/bc/adt/atc/atcContractdefinitions withworklistsContractandresultsContractimports(method, path, headers, query parameters)
definition vs client call tests
walker-attribute-ref.test.ts
Walker attribute reference resolution testspackages/ts-xsd/tests/unit/walker-attribute-ref.test.ts
walkAttributes()with attribute references (ref)support
$imports, namespace-prefixed refs, and ref merging with use overridescomplexContent/extension, and fallback behavior for missing attributes
atc.test.ts
ATC schema test scenarios for customizing and worklistpackages/adt-schemas/tests/scenarios/atc.test.ts
AtcCustomizingScenariovalidates properties, exemption reasons, andjustification requirements
AtcWorklistScenariovalidates object sets, objects with findings, andinfo entries with detailed attribute checks
attributes
interface-generator.test.ts
Update interface generator tests for new APIpackages/ts-xsd/tests/unit/interface-generator.test.ts
rootElementparameter fromgenerateInterfaces()calls (nowoptional)
as unknown as Schemato test schemas for typecompatibility
typed-client.test.ts
Typed contract client tests with schema inferencepackages/adt-contracts/tests/typed-client.test.ts
from schemas
worklists
definitions
deserializer.test.ts
Deserializer tests for ABAP object fixturespackages/adt-plugin-abapgit/tests/deserializer.test.ts
files
FileTreethat reads from fixtures directory with globsupport
type-parse-consistency.test.ts
Type and parse consistency validation testspackages/ts-xsd/tests/unit/type-parse-consistency.test.ts
parse()behavior and generated typedefinitions
discrimination
classes.test.ts
Update class scenario tests for wrapped response formatpackages/adt-schemas/tests/scenarios/classes.test.ts
{ elementName:content }validateParsed()to extractabapClassfrom wrapped responseabapClassobjectoverridekeyword tovalidateBuilt()methodatc-typed.test.ts
Typed ATC worklist contract scenario examplepackages/adt-contracts/tests/contracts/atc-typed.test.ts
inference
TypedContractScenariowith contract and schema typeschecking
narrowing
xml-roundtrip.test.ts
XML roundtrip tests for wrapped parse formatpackages/ts-xsd/tests/integration/xml-roundtrip.test.ts
parse(){ elementName: content }wrapperbuildXml()accepts both wrapped and unwrapped formatsmock-adapter.ts
Mock HTTP adapter for contract testingpackages/adt-contracts/tests/contracts/base/mock-adapter.ts
calls
createMockAdapter()andcreateSimpleMockAdapter()factoriespackages.test.ts
Update package scenario tests for wrapped response formatpackages/adt-schemas/tests/scenarios/packages.test.ts
{ elementName:content }pkgfrom wrapped response before assertionspkgobjectoverridekeyword tovalidateBuilt()method3 files
abapgit-examples
Add abapgit-examples git submodulegit_modules/abapgit-examples
content-type-mapping.ts
Content type to schema name mapping configurationpackages/adt-contracts/config/contracts/content-type-mapping.ts
endpoints
resolution
.nxignore
Nx ignore configuration for config filespackages/adt-contracts/.nxignore
analysis
2 files
errors.ts
ADT error handling with exception parsingpackages/adt-client/src/errors.ts
AdtErrorclass forstructured exception details
parseAdtException()function to parse SAP ADT XML exceptions intotyped
AdtExceptionDatacreateAdtError()factory function for creating errors fromHTTP responses
AdtErrorfor type checking and propertyaccess
adapter.ts
Adapter error handling with ADT exception parsingpackages/adt-client/src/adapter.ts
createAdtError()for structured error handling withexception parsing
literals
build()method with detailed errorlogging
2 files
auth-core.ts
Browser auth with cookie clearing and validationpackages/browser-auth/src/auth-core.ts
session
CookieDatatype importtransport.ts
Transport response unwrapping and property fixespackages/adk/src/objects/cts/transport/transport.ts
load()method to accessresponse.rootget()method to unwrap root element from responseAdkTransportTask.get()to unwrap response before creatinginstance
getConfigUri()to accessconfigurationsinstead ofconfiguration101 files