Skip to content

Make core-commit.json pin authoritative in CoreCommit.ps1 - #5016

Merged
Weidong Xu (weidongxu-microsoft) merged 2 commits into
release/july-2026from
fix/typespec-java-core-commit-pin-july-2026
Jul 22, 2026
Merged

Weidong Xu (weidongxu-microsoft) merged 2 commits into
release/july-2026from
fix/typespec-java-core-commit-pin-july-2026

Conversation

@weidongxu-microsoft

Copy link
Copy Markdown
Member

Cherry-pick of the fix validated on the backmerge PR #5014.

Problem

  • 'CoreCommit.ps1' + gated advancing to the pinned + 'core-commit.json' + SHA on + 'git merge-base --is-ancestor ' + . In CI the + 'core' + submodule is a shallow clone, so the connecting history between the checkout and the pin is absent and the ancestry check fails. The script then silently fell back to the submodule checkout and built the Java emitter from the wrong core sources (e.g. pre-XML-fix code referencing a non-generated + 'XmlSerializerProviders' + ).

Fix

  • The pin in + 'core-commit.json' + is now authoritative: always build from exactly that commit via + 'git archive' + , regardless of ancestry.
  • Hardened the fetch with a post-fetch existence check that errors clearly instead of silently falling back.
  • Updated the header doc.

Verified locally: with the submodule at + ' eafcd0e' + and pin + '43ff0041' + (the exact CI failure scenario), it now archives + '43ff0041' + with the generator subtree present.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7

Remove the  + 'merge-base --is-ancestor' +  gate that only advanced to the
pinned core commit when it was a descendant of the submodule checkout. A
shallow submodule clone (as on CI) lacks the connecting history and cannot
prove ancestry, so the gate silently fell back to the submodule checkout and
built the Java emitter from the wrong core sources (e.g. pre-XML-fix code
referencing a non-generated XmlSerializerProviders).

The pin in core-commit.json is now authoritative: always build from exactly
that commit via git archive, harden the fetch with a post-fetch existence
check, and update the header doc accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
@azure-sdk-automation

azure-sdk-automation Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • ❌@azure-tools/typespec-autorest

The following packages have already been documented:

  • ✅ @azure-tools/typespec-java
Show changes

@azure-tools/typespec-java - internal ✏️

Make the core-commit.json pin authoritative in CoreCommit.ps1: always build the Java emitter from exactly the pinned core commit via git archive instead of gating on a merge-base ancestry check that a shallow CI clone cannot evaluate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

@pkg-pr-new

pkg-pr-new Bot commented Jul 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-autorest@5016
npm i https://pkg.pr.new/@azure-tools/typespec-java@5016

commit: f3431d1

@weidongxu-microsoft
Weidong Xu (weidongxu-microsoft) merged commit 0606213 into release/july-2026 Jul 22, 2026
29 checks passed
@weidongxu-microsoft
Weidong Xu (weidongxu-microsoft) deleted the fix/typespec-java-core-commit-pin-july-2026 branch July 22, 2026 08:40
Weidong Xu (weidongxu-microsoft) added a commit that referenced this pull request Jul 24, 2026
Version bump for the typespec-java hotfix **0.45.10**, following the
sync in #5043.

## Included changes (consumed from  + '.chronus/changes' + )
- **fix**: Expose the + ' equired-fields-as-ctor-args' + emitter option
in + ' spconfig.yaml' + (microsoft/typespec#11380). Default remains + '
rue' + .
- **internal**: Make the + 'core-commit.json' + pin authoritative in +
'CoreCommit.ps1' + (#5016).

## Files
-  + 'packages/typespec-java/package.json' +  -> 0.45.10
-  + 'packages/typespec-java/CHANGELOG.md' + 
- + 'packages/typespec-java/emitter-tests/package.json' + -> 0.45.10
(version + + '.tgz' + dep)
- Deleted the two consumed typespec-java change files

Only + '@azure-tools/typespec-java' + is bumped. Non-java pending change
files (tcgc, benchmark, playground, website) were intentionally left
untouched. The + 'core' + submodule is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd6f2e08-d6d3-42ae-affd-bc71e98086f7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:java Issues for @azure-tools/typespec-java emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants