Skip to content

Commit 07543e8

Browse files
committed
Sync regexp changes
1 parent 3c3cc0a commit 07543e8

3 files changed

Lines changed: 20 additions & 35 deletions

File tree

.github/workflows/java-publish-maven.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
else
8888
# Split version: supports "0.1.32", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
8989
# Validate RELEASE_VERSION format explicitly to provide clear errors
90-
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-java(-preview)?\.[0-9]+)?$'; then
91-
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-java.N, or M.M.P-java-preview.N (e.g., 1.2.3, 1.2.3-java.0, or 1.2.3-java-preview.0)." >&2
90+
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-(beta-)?java(-preview)?\.[0-9]+)?$'; then
91+
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-java.N, M.M.P-java-preview.N, M.M.P-beta-java.N, or M.M.P-beta-java-preview.N (e.g., 1.2.3, 1.2.3-java.0, 1.2.3-java-preview.0, 1.2.3-beta-java.0, or 1.2.3-beta-java-preview.0)." >&2
9292
exit 1
9393
fi
9494
# Extract the base M.M.P portion (before any qualifier)
@@ -121,21 +121,21 @@ jobs:
121121
# Update CHANGELOG.md with release version and Reference implementation sync hash
122122
./.github/scripts/release/update-changelog.sh "${VERSION}" "${REFERENCE_IMPL_HASH}"
123123
124-
# Update version in README.md (supports versions like 1.0.0, 0.1.32-java.0, and 0.3.0-java-preview.0)
125-
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}</version>|<version>${VERSION}</version>|g" README.md
126-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" README.md
124+
# Update version in README.md (supports any version qualifier like -java.N, -java-preview.N, -beta-java.N)
125+
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*</version>|<version>${VERSION}</version>|g" README.md
126+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" README.md
127127
128128
# Update snapshot version in README.md
129129
DEV_VERSION="${{ steps.versions.outputs.dev_version }}"
130-
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md
130+
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*-SNAPSHOT</version>|<version>${DEV_VERSION}</version>|g" README.md
131131
132132
# Update version in jbang-example.java
133-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" jbang-example.java
133+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" jbang-example.java
134134
sed -i 's|copilot-sdk-java:${project\.version}|copilot-sdk-java:'"${VERSION}"'|g' jbang-example.java
135135
136136
# Update version in cookbook files (hardcoded for direct GitHub browsing and JBang usage)
137137
find src/site/markdown/cookbook -name "*.md" -type f -exec \
138-
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\(-preview\)\{0,1\}\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" {} \;
138+
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*|copilot-sdk-java:${VERSION}|g" {} \;
139139
140140
# Commit the documentation changes before release:prepare (requires clean working directory)
141141
git add CHANGELOG.md README.md jbang-example.java src/site/markdown/cookbook/

80-java-monorepo-add-01-remove-before-merge/20260515-prompts.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,10 @@ This is the standard pattern used by Maven projects that release via CI (Spring,
116116
Note: only this one workflow (`java-publish.yml`) needs the bypass. All other Java workflows (`java-sdk-tests.yml`, `java-smoke-test.yml`, `java-codegen-fix.md`, etc.) operate via normal PRs.
117117

118118
---
119+
120+
121+
### 13:57 Prompt
122+
123+
The code in `copilot-sdk-java-00` has been updated. In particular there have been changes to the workflows there. I am aware we have copied over at least one workflow in the process of performing Phase 0 work according to the plan.
124+
125+
Examine the recent workflow changes in `copilot-sdk-java-00` and make the corresponding Java changes to keep the `copilot-sdk-00` side up to date.

80-java-monorepo-add-01-remove-before-merge/dd-2989727-move-java-to-monorepo-plan.md

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,7 @@
4545

4646
2. Update `pom.xml` paths if needed (should be self-contained under `java/`).
4747

48-
3. Verify `mvn verify` works from `java/` directory locally.
49-
50-
4. Add `justfile` targets for Java:
51-
52-
```just
53-
format-java:
54-
@echo "=== Formatting Java code ==="
55-
@cd java && mvn spotless:apply
56-
57-
lint-java:
58-
@echo "=== Linting Java code ==="
59-
@cd java && mvn spotless:check
60-
61-
test-java:
62-
@echo "=== Testing Java code ==="
63-
@cd java && mvn verify
64-
65-
install-java: install-nodejs install-test-harness
66-
@echo "=== Installing Java dependencies ==="
67-
@cd java && mvn dependency:go-offline
68-
```
69-
70-
5. Update top-level `format`, `lint`, `test`, `install` recipes to include Java.
48+
3. Verify `mvn clean verify` works from `java/` directory locally. Make necessary changes so the test infrastructure is copied locally, rather than checked out.
7149

7250
### Phase 2: CI Workflows
7351

@@ -378,7 +356,7 @@ What changes is the **mechanism**: instead of polling a remote repository, the w
378356
| **Composite Action:** `test-report` | `.github/actions/test-report/` | Test report generation | Yes |
379357
| **Scripts:** `release/`, `ci/`, `build/`, `reference-impl-sync/` | `.github/scripts/` | Release, CI, sync automation | Yes — **path rewrites** |
380358
| **Dependabot:** `dependabot.yml` | `.github/` | Maven + GitHub Actions updates | Merge into monorepo's `dependabot.yaml` |
381-
| **CODEOWNERS** | `.github/` | ~~`@github/copilot-sdk-java` | Merge into monorepo's CODEOWNERS~~ |
359+
| **CODEOWNERS** | `.github/` | ~~`@github/copilot-sdk-java` | Merge into monorepo's CODEOWNERS~~ |
382360
| **Issue Templates:** bug, documentation, feature, maintenance | `.github/ISSUE_TEMPLATE/` | Issue forms | Assess whether monorepo issue triage covers this |
383361
| **PR Template** | `.github/pull_request_template.md` | PR form | Merge or keep per-language |
384362
| **Release Config** | `.github/release.yml` | Auto-generated release notes config | Merge |
@@ -422,9 +400,9 @@ What changes is the **mechanism**: instead of polling a remote repository, the w
422400
| # | Risk | Impact | Mitigation |
423401
| --- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
424402
| M1 | **Codegen `package.json` merge** | Java codegen has its own `@github/copilot` dependency; monorepo codegen gets it from `nodejs/node_modules` | Align Java codegen to use the same dependency source. May need to add `generate:java` script to monorepo's `scripts/codegen/package.json`. |
425-
| M2 | ~~**GitHub Pages conflict**~~ | ~~Java deploys versioned docs to Pages. Monorepo may have its own Pages setup.~~ | ~~Use subdirectory deployment or a separate Pages branch for Java.~~ |
403+
| M2 | ~~**GitHub Pages conflict**~~ | ~~Java deploys versioned docs to Pages. Monorepo may have its own Pages setup.~~ | ~~Use subdirectory deployment or a separate Pages branch for Java.~~ |
426404
| M3 | **Branch protection / required checks** | New `java-sdk-tests` check may not be in the required list | Add to branch protection after first successful run. |
427-
| M4 | **CODEOWNERS team permissions** | `@github/copilot-sdk-java` team may not have write access to `github/copilot-sdk` | Verify team access and add to repo collaborators. See https://github.com/github/copilot-sdk-partners/issues/89 |
405+
| M4 | **CODEOWNERS team permissions** | `@github/copilot-sdk-java` team may not have write access to `github/copilot-sdk` | Verify team access and add to repo collaborators. See https://github.com/github/copilot-sdk-partners/issues/89 |
428406
| M5 | **`copilot-setup-steps.yml` bloat** | Adding JDK + Maven makes agent setup slower for non-Java tasks | Acceptable trade-off; other languages already add their tools. Could consider conditional setup but that's over-engineering. |
429407
| M6 | **gh-aw version mismatch** | Java repo uses gh-aw `v0.68.3` setup action pinned at `v0.71.5`; monorepo uses `v0.64.2` reference in docs | Align gh-aw versions. Use the newer version. Recompile all `.lock.yml` files. |
430408

@@ -545,7 +523,7 @@ What changes is the **mechanism**: instead of polling a remote repository, the w
545523
| **Codegen** | Own `java.ts` + own `@github/copilot` dep | Shared codegen scripts + shared dep | Needs reconciliation |
546524
| **CI runner** | JDK 17 + JDK 25 (smoke test) | Node 22, Python 3.12, Go 1.24, .NET 10, Rust 1.94 | Just another tool in `copilot-setup-steps.yml` |
547525
| **Publishing** | Maven Central (GPG + Sonatype) | npm, PyPI, NuGet, crates.io, Go tags | Completely different mechanism |
548-
| **Docs hosting** | ~~GitHub Pages (Maven site)~~ | ~~Not clear if monorepo has its own~~ | ~~Potential conflict~~ |
526+
| **Docs hosting** | ~~GitHub Pages (Maven site)~~ | ~~Not clear if monorepo has its own~~ | ~~Potential conflict~~ |
549527
| **Reference impl tracking** | `.lastmerge` + scheduled sync + agentic merge skill | N/A (they ARE the reference impl) | `.lastmerge` stores monorepo SHA; sync becomes intra-repo but is still needed because Java maintainers ≠ .NET/Node maintainers |
550528

551529
---

0 commit comments

Comments
 (0)