Skip to content

fix(generator-adp): write headless generation result for BAS orchestrator#4973

Merged
testojs merged 3 commits into
mainfrom
fix/4972/generator-adp-write-result
Jul 22, 2026
Merged

fix(generator-adp): write headless generation result for BAS orchestrator#4973
testojs merged 3 commits into
mainfrom
fix/4972/generator-adp-write-result

Conversation

@testojs

@testojs testojs commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fix for #4972.

  • Adds the missing BAS orchestrator result callback to @sap-ux/generator-adp: when headless generation completes, the project path (or Failure: on error) is written to /home/user/tmpProjectTemplate.json under the correlation id from the JSON input, so the Lobby can poll and resolve the generation result.

@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3bd60ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sap-ux/generator-adp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Description

Fixes the missing BAS orchestrator result callback in @sap-ux/generator-adp. When headless generation is triggered via JSON input (e.g., from the SAP Business Application Studio Lobby), the generator now writes the outcome to /home/user/tmpProjectTemplate.json under the correlation id from the JSON payload, allowing the orchestrator to poll and resolve the generation result.

Changes:

  • Added id?: string to the JsonInput interface and updated the isJsonInput type guard to validate the new optional field
  • Added src/utils/write-result.ts with a writeResult() utility that merges { [id]: result } into the orchestrator result file, treating missing/malformed files as empty and swallowing write failures so they never mask real generation errors
  • In writing() catch block: writes Failure: <message> before rethrowing when jsonInput?.id is present
  • In end(): writes the generated project path on success when jsonInput?.id is present
  • Both paths are gated on jsonInput?.id — CLI and interactive use are completely unaffected

Type of change

  • Bug (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a new feature)
  • Breaking change (Bug or New feature that would cause existing functionality/consumers to not work as expected)
  • Non-Breaking chores (Changes to tools, libraries, build process, documentation, etc)
  • None of the above (Reviewers might ask for more clarification)

How have you tested?

  • Added unit tests for write-result.ts covering: file not existing, failure results, merging with existing entries, malformed/non-object/array file content, and swallowed write failures
  • Added integration tests in app.test.ts verifying writeResult is called with the correct project path on success and Failure: <message> on error, and is not called when no id is provided

Checklist:

  • The code conforms to the general development principles
  • Supplied as many details as possible on this change
  • The code is easy to read and maintainable by others
  • Corresponding changes to the documentation has been done
  • Already existing and new unit tests pass locally

Fixes #4972


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.28.2

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR introduces a clean, well-tested feature for writing headless generation results back to the BAS orchestrator. Two issues were flagged: a potential overwrite of a failure result by the subsequent end() lifecycle hook, and a hardcoded absolute path that cannot be overridden for non-BAS environments.

PR Bot Information

Version: 1.28.2

  • Correlation ID: a5539230-85ad-11f1-938a-1b32755876ef
  • File Content Strategy: Full file content
  • Agent Instructions:
  • Event Trigger: pull_request.opened
  • LLM: anthropic--claude-4.6-sonnet

Comment thread packages/generator-adp/src/app/index.ts
Comment thread packages/generator-adp/src/utils/write-result.ts

@IvoSG IvoSG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changeset OK
Changes look good
Coverage is great
Do not test manually

@mmilko01 mmilko01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changeset OK
Changes look good
Excellent test coverage
Did not test manually

@sonarqubecloud

Copy link
Copy Markdown

@testojs
testojs merged commit 0123b0f into main Jul 22, 2026
26 of 27 checks passed
@testojs
testojs deleted the fix/4972/generator-adp-write-result branch July 22, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

generator-adp @sap-ux/generator-adp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants