Skip to content
Merged
44 changes: 44 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Copilot Setup Steps'

# Run automatically when changed, and allow manual validation from the Actions tab.
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# Must be named exactly `copilot-setup-steps` for Copilot to pick it up.
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2

- name: Install dependencies
run: bun install

- name: Install pre-commit format hook for Copilot agent
run: |
mkdir -p .git/copilot-hooks
cat > .git/copilot-hooks/pre-commit << 'EOF'
#!/bin/sh
# Auto-format all staged files before committing.
# Runs nx format:write (Prettier) and re-stages any files it changed.
if command -v bunx >/dev/null 2>&1; then
bunx nx format:write --uncommitted
else
npx nx format:write --uncommitted
fi
git update-index --again
EOF
chmod +x .git/copilot-hooks/pre-commit
6 changes: 5 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
npx nx format:write --uncommitted
if command -v bunx >/dev/null 2>&1; then
bunx nx format:write --uncommitted
else
npx nx format:write --uncommitted
fi
Comment on lines +1 to +5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. npx fallback in hooks 📘 Rule violation ✧ Quality

The PR adds npx usage in the pre-commit hook and Copilot setup workflow, violating the requirement
to use bun/bunx exclusively. This can lead to inconsistent toolchains across environments and
breaks the bun-only compliance policy.
Agent Prompt
## Issue description
Modified hook/workflow uses `npx`, but policy requires `bun`/`bunx` exclusively.

## Issue Context
Compliance ID 339850 disallows `npm`/`npx`/`yarn`/`pnpm` usage in changed scripts and CI.

## Fix Focus Areas
- .husky/pre-commit[1-5]
- .github/workflows/copilot-setup-steps.yml[30-41]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

git update-index --again

285 changes: 285 additions & 0 deletions packages/adt-mcp/src/lib/mock/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ export const fixtures = {
},
},

// Transport create response – returned for POST /sap/bc/adt/cts/transportrequests
transportCreate: {
root: {
request: {
trkorr: 'DEVK900099',
as4text: 'New transport',
as4user: 'DEVELOPER',
trstatus: 'D',
trfunction: 'K',
},
},
},

atcRun: {
worklistId: 'WL_001',
id: 'RUN_001',
Expand Down Expand Up @@ -177,4 +190,276 @@ export const fixtures = {
],
},
},

// Grep / content search results – returned for GET .../informationsystem/search?userannotation=userwhere
grepResults: {
objectReference: [
{
name: 'ZCL_EXAMPLE',
type: 'CLAS/OC',
uri: '/sap/bc/adt/oo/classes/zcl_example',
description: 'Example class',
packageName: 'ZPACKAGE',
},
],
},

// DDIC table definition – returned for GET /sap/bc/adt/ddic/tables/{name}
tableDefinition: {
blueSource: {
name: 'MARA',
description: 'General Material Data',
type: 'TABL/DT',
element: [
{ name: 'MANDT', type: 'CLNT', length: '3', description: 'Client' },
{
name: 'MATNR',
type: 'CHAR',
length: '18',
description: 'Material Number',
},
{
name: 'MBRSH',
type: 'CHAR',
length: '1',
description: 'Industry Sector',
},
],
},
},

// Data preview result – returned for POST /sap/bc/adt/datapreview/freestyle
tableContents: {
columns: {
column: [
{ name: 'MANDT', type: 'C', length: '3' },
{ name: 'MATNR', type: 'C', length: '18' },
{ name: 'MBRSH', type: 'C', length: '1' },
],
},
rows: {
row: [
{
cell: [
{ _text: '100' },
{ _text: 'Z_EXAMPLE_MATERIAL' },
{ _text: 'A' },
],
},
],
},
},

// Navigation target – returned for GET /sap/bc/adt/navigation/target
navigationTarget: {
objectReference: {
uri: '/sap/bc/adt/oo/classes/zcl_example',
type: 'CLAS/OC',
name: 'ZCL_EXAMPLE',
description: 'Example class',
},
},

// Usages / references – returned for GET .../informationsystem/usages
usagesResult: {
usages: {
usage: [
{
uri: '/sap/bc/adt/programs/programs/zprog_example',
name: 'ZPROG_EXAMPLE',
type: 'PROG',
location: 'line 42',
},
],
},
},

// Call hierarchy callers – returned for GET .../informationsystem/callers
callersResult: {
callers: {
caller: [
{
uri: '/sap/bc/adt/programs/programs/zprog_main',
name: 'ZPROG_MAIN',
type: 'PROG',
},
],
},
},

// Call hierarchy callees – returned for GET .../informationsystem/callees
calleesResult: {
callees: {
callee: [
{
uri: '/sap/bc/adt/functions/groups/zfugr_util',
name: 'ZFUGR_UTIL',
type: 'FUGR',
},
],
},
},

// Inactive objects – returned for GET /sap/bc/adt/activation/inactive_objects
inactiveObjects: {
objectReference: [
{
name: 'ZCL_EXAMPLE',
type: 'CLAS/OC',
uri: '/sap/bc/adt/oo/classes/zcl_example',
description: 'Example class',
},
],
},

// Function group metadata – returned for GET /sap/bc/adt/functions/groups/{name}
functionGroup: {
abapFunctionGroup: {
name: 'ZFUGR_UTIL',
type: 'FUGR',
description: 'Utility function group',
language: 'EN',
masterLanguage: 'EN',
packageRef: { uri: '/sap/bc/adt/packages/zpackage' },
},
},

// Function module metadata – returned for GET /sap/bc/adt/functions/groups/{g}/fmodules/{fm}
functionModule: {
abapFunctionModule: {
name: 'Z_MY_FUNCTION',
type: 'FUGR/FF',
description: 'My utility function module',
processingType: 'normal',
remoteEnabledMode: 'notRemoteEnabled',
parameters: {
importParameters: {
parameter: [
{
name: 'IV_INPUT',
type: 'TYPE',
associatedType: 'STRING',
optional: true,
},
],
},
exportParameters: {
parameter: [
{
name: 'EV_OUTPUT',
type: 'TYPE',
associatedType: 'STRING',
},
],
},
},
},
},

// Object structure – returned for GET {objectUri}/objectstructure
objectStructure: {
objectStructure: {
objectReference: {
uri: '/sap/bc/adt/oo/classes/zcl_example',
type: 'CLAS/OC',
name: 'ZCL_EXAMPLE',
description: 'Example class',
},
includes: {
include: [
{
uri: '/sap/bc/adt/oo/classes/zcl_example/includes/definitions',
type: 'CLAS/OC/D',
name: 'ZCL_EXAMPLE',
},
{
uri: '/sap/bc/adt/oo/classes/zcl_example/includes/implementations',
type: 'CLAS/OC/M',
name: 'ZCL_EXAMPLE',
},
],
},
},
},

// Type hierarchy – returned for GET /sap/bc/adt/oo/typeinfo
typeHierarchy: {
typeInfo: {
objectReference: {
uri: '/sap/bc/adt/oo/classes/zcl_example',
type: 'CLAS/OC',
name: 'ZCL_EXAMPLE',
},
superClasses: {
superClass: [
{
uri: '/sap/bc/adt/oo/classes/object',
type: 'CLAS/OC',
name: 'OBJECT',
},
],
},
interfaces: {
interface: [],
},
},
},

// Pretty-printed source – returned for POST /sap/bc/adt/prettyprinter/prettifySource
prettySource:
'CLASS zcl_example DEFINITION PUBLIC FINAL CREATE PUBLIC.\n PUBLIC SECTION.\n METHODS: do_something.\nENDCLASS.\n',

// Installed software components – GET /sap/bc/adt/system/softwarecomponents
softwareComponents: {
softwareComponents: {
softwareComponent: [
{
name: 'SAP_BASIS',
release: '756',
patchLevel: '0012',
description: 'SAP Basis Component',
},
{
name: 'SAP_ABA',
release: '756',
patchLevel: '0012',
description: 'Cross-Application Component',
},
],
},
},

// abapGit exportable objects – GET /sap/bc/adt/abapgit/objects
gitObjects: {
abapgitObjects: {
object: [
{
name: 'ZCL_EXAMPLE',
type: 'CLAS',
uri: '/sap/bc/adt/oo/classes/zcl_example',
},
{
name: 'ZPROG_EXAMPLE',
type: 'PROG',
uri: '/sap/bc/adt/programs/programs/zprog_example',
},
],
},
},

// abapGit export – GET /sap/bc/adt/abapgit/repos/{name}/export
gitExport: {
files: [
{
path: 'src/zcl_example.clas.abap',
content:
'CLASS zcl_example DEFINITION PUBLIC FINAL CREATE PUBLIC.\nENDCLASS.',
},
{
path: 'src/zcl_example.clas.xml',
content:
'<?xml version="1.0" ?><abapGit version="v1.0.0"><asx:abap></asx:abap></abapGit>',
},
],
},
};
Loading
Loading