Skip to content

Refactor RemoteSpecification#7111

Merged
isaacroldan merged 13 commits into
mainfrom
03-26-refactor_remotespecification
Mar 31, 2026
Merged

Refactor RemoteSpecification#7111
isaacroldan merged 13 commits into
mainfrom
03-26-refactor_remotespecification

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Simplify types and transformations of specification definitions:

  • Made RemoteSpecification a flatten generic object.

  • Added PartnersRemoteSpecification to represent the spec results from Partners (this is to be deprecated with Partners)

  • Removed FlattenedRemoteSpecification

  • Transform from PartnersRemoteSpecification to RemoteSpecification and not the other way around.

  • Simplify logic for handleInvalidAdditionalProperties now only strip for configuration modules.

isaacroldan commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isaacroldan isaacroldan force-pushed the 03-26-refactor_remotespecification branch from 2a55801 to 10cf614 Compare March 26, 2026 12:07
@isaacroldan isaacroldan force-pushed the 03-23-feat_fetch_experience_field_from_api_instead_of_hardcoding_it branch from e123eb9 to c539bc0 Compare March 26, 2026 12:12
@isaacroldan isaacroldan force-pushed the 03-26-refactor_remotespecification branch from 10cf614 to e55dc00 Compare March 26, 2026 12:12
Base automatically changed from 03-23-feat_fetch_experience_field_from_api_instead_of_hardcoding_it to main March 26, 2026 12:24
@isaacroldan isaacroldan force-pushed the 03-26-refactor_remotespecification branch from e55dc00 to 0c990bc Compare March 26, 2026 12:30
@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.31% 15127/18378
🟡 Branches 74.83% 7443/9947
🟢 Functions 81.32% 3801/4674
🟢 Lines 82.7% 14303/17295

Test suite run success

4000 tests passing in 1531 suites.

Report generated by 🧪jest coverage report action from 1039df1

dependabot Bot and others added 9 commits March 27, 2026 15:49
Bumps [yaml](https://github.com/eemeli/yaml) from 2.7.0 to 2.8.3.
- [Release notes](https://github.com/eemeli/yaml/releases)
- [Commits](eemeli/yaml@v2.7.0...v2.8.3)

---
updated-dependencies:
- dependency-name: yaml
  dependency-version: 2.8.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the nx group with 1 update in the / directory: [nx](https://github.com/nrwl/nx/tree/HEAD/packages/nx).


Updates `nx` from 22.5.4 to 22.6.1
- [Release notes](https://github.com/nrwl/nx/releases)
- [Commits](https://github.com/nrwl/nx/commits/22.6.1/packages/nx)

---
updated-dependencies:
- dependency-name: nx
  dependency-version: 22.6.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: nx
...

Signed-off-by: dependabot[bot] <support@github.com>
First pass, not final agent shape
When the JWT for app log polling expires, handleFetchAppLogsError calls
onResubscribe() to get a fresh token. If onResubscribe() itself throws
(network error, expired session), the exception propagates unhandled,
causing the dev polling loop to retry every 5s with the same expired
JWT — an infinite 401 loop.

Wrap onResubscribe() in a try-catch so failures fall back to a 60s
retry interval instead of propagating. This is a 12x reduction in 401
rate per affected client and allows self-healing when the underlying
issue resolves.
@isaacroldan isaacroldan force-pushed the 03-26-refactor_remotespecification branch 3 times, most recently from f2da66b to a99bc03 Compare March 27, 2026 18:18
@isaacroldan isaacroldan marked this pull request as ready for review March 27, 2026 18:24
@isaacroldan isaacroldan requested a review from a team as a code owner March 27, 2026 18:24
Copilot AI review requested due to automatic review settings March 27, 2026 18:24
@github-actions

Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

Copilot AI 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.

Pull request overview

Refactors how extension specifications are represented and merged by introducing a flattened RemoteSpecification shape, aligning both Partners and App Management clients to return that shape, and simplifying downstream merging/validation behavior.

Changes:

  • Introduces a flattened RemoteSpecification type and updates Partners/App Management clients to return it.
  • Refactors spec fetching/merging to work with the flattened remote shape and simplifies additional-properties handling based on experience.
  • Updates local contract-based spec creation to accept experience, and adjusts test fixtures to match the new remote spec shape.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/app/src/cli/utilities/json-schema.ts Updates unified parser factory signature to accept validation schema separately from the merged spec.
packages/app/src/cli/utilities/developer-platform-client/partners-client.ts Maps Partners API spec shape into flattened RemoteSpecification (derives uidStrategy, hoists fields).
packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts Emits flattened RemoteSpecification; updates uidStrategyFromTypename to always return a strategy.
packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts Updates unit test to reflect new default behavior for unknown uid strategy typenames.
packages/app/src/cli/services/generate/fetch-extension-specifications.ts Refactors remote/local merge logic for flattened specs; changes additionalProperties stripping rules.
packages/app/src/cli/services/generate/fetch-extension-specifications.test.ts Updates expectations to align with new merged spec shape.
packages/app/src/cli/models/extensions/specifications/channel.ts Provides explicit uidStrategy and experience when building a contract-based spec.
packages/app/src/cli/models/extensions/specification.ts Extends createContractBasedModuleSpecification input to include experience and forwards it through.
packages/app/src/cli/models/app/app.test-data.ts Updates test remote specification fixtures to the flattened shape (hoists options/features-derived fields).
packages/app/src/cli/api/graphql/extension_specifications.ts Introduces flattened RemoteSpecification type; adds PartnersRemoteSpecification for Partners query shape.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/app/src/cli/utilities/json-schema.ts
Comment thread packages/app/src/cli/services/generate/fetch-extension-specifications.ts Outdated
Comment thread packages/app/src/cli/services/generate/fetch-extension-specifications.ts Outdated
@isaacroldan isaacroldan force-pushed the 03-26-refactor_remotespecification branch from a99bc03 to 9205739 Compare March 27, 2026 18:39

@ryancbahan ryancbahan 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.

nice refactor. i've been thinking about this area lately -- i'd love for us to get remotespec and extension instance to be much lighter representations of the data itself, with commands owning the behaviors they need rather than threading them on the spec/instance. curious if this aligns/misaligns with your thinking?

Copy link
Copy Markdown
Contributor Author

Aligned on making the specs/extension instance lighter, but not sure I see how the commands would own the behaviours they need for each extension type :thinking_face: Some behaviours are shared (like validation or building)

@isaacroldan isaacroldan added this pull request to the merge queue Mar 31, 2026
@ryancbahan

Copy link
Copy Markdown
Contributor

@isaacroldan shared, composable utils per-domain, backed by registries, is what i imagine

Merged via the queue into main with commit 8675dae Mar 31, 2026
26 checks passed
@isaacroldan isaacroldan deleted the 03-26-refactor_remotespecification branch March 31, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants