Skip to content

[EndpointsBDD release infra] Add conditional copy of endpoint-bdd-1.json model - #7335

Open
alextwoods wants to merge 1 commit into
feature/master/endpoints-bddfrom
alexwoo/endpoints-bdd-pr6
Open

[EndpointsBDD release infra] Add conditional copy of endpoint-bdd-1.json model#7335
alextwoods wants to merge 1 commit into
feature/master/endpoints-bddfrom
alexwoo/endpoints-bdd-pr6

Conversation

@alextwoods

@alextwoods alextwoods commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

[EndpointsBDD release infra] Add conditional copy of endpoint-bdd-1.json model

This is the release infrastructure PR to support the Endpoints BDD. It depends on the BDD implementation, primarily in:

Note: This PR merges to the feature/master/endpoints-bdd feature branch and NOT to master.

Motivation and Context

We are gating generating a BDD based endpoint resolver on whether the endpoint-bdd-1.json model is present or not. This lets us opt-in services without requiring yet another customization.config key that ends up living long after the release is complete.

The UpdateServiceMain is repsonible for copying the model files from a new preview/release build into the correct service directory. This PR adds a conditional copy of the endpoint BDD file - ONLY when it is already present will we copy it.

Note: the conditional copy is TEMPORARY - once we have completed batched/phased release we will remove the the copyFileIfAlreadyPresent and just use the standard copyFile method.

Testing

Added new unit tests.

License

  • I confirm that this pull request can be released under the Apache 2 license

@alextwoods
alextwoods requested a review from a team as a code owner August 31, 2026 21:20
@alextwoods
alextwoods changed the base branch from master to feature/master/endpoints-bdd August 31, 2026 21:21
@alextwoods alextwoods added changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required labels Aug 31, 2026
Lets the release script carry endpoint-bdd-1.json for a service, without
that being what decides whether the service uses the BDD endpoint
provider.

The provider is selected by codegen purely on whether the model file is
present, so an unconditional copy would move every service onto the BDD
path on the first release that carried the model. copyFileIfAlreadyPresent
therefore checks the destination first and updates the file only for a
service that already has one. Adding the file by hand stays the act of
opting a service in, which is what makes a phased rollout possible; the
script keeps it refreshed from then on.

The existing copyFile is left alone for the other models. Gating those
would be wrong: a service legitimately gains waiters-2.json or
endpoint-tests.json for the first time, and those should land on the
release that carries them.

The argument is optional, so callers that do not pass it are unaffected.
Note that release automation lives outside this repo and has to start
passing --endpoint-bdd-json for any of this to take effect.

Testing:
- Seven tests driving UpdateServiceMain.main with temp directories, so
  the option registration and the resolved destination are covered along
  with the gate. An unregistered option would silently ignore the
  argument, which a test of the helper alone would not catch.
- Cases: absent destination is not created; existing destination is
  overwritten; an empty existing file still counts as present; omitting
  the argument leaves an opted-in model alone; the other five models are
  still copied unconditionally; and the gate applies to DynamoDB's nested
  codegen-resources directory rather than the module root.
- Mutation checked. Swapping in the unconditional copyFile, and gating on
  the source instead of the destination, each fail
  endpointBddJson_notAlreadyPresent_isNotCopied.
- release-scripts had no test tree, so junit-jupiter and assertj-core are
  added at test scope. checkstyle clean, spotbugs 0 bugs.
@alextwoods
alextwoods force-pushed the alexwoo/endpoints-bdd-pr6 branch from 6f87ba9 to 29cc5ef Compare August 31, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants