Skip to content

Commit 42b3eb0

Browse files
committed
Fix DEPS and the process to update DEPS in the future
1 parent 1c194ce commit 42b3eb0

6 files changed

Lines changed: 35 additions & 23 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,25 @@ jobs:
8080
echo "Compiling Java source from tag ${{ inputs.monorepo_tag }}"
8181
mvn clean compile test -DskipTests=false -Dcheckstyle.skip=true -B
8282
83-
# 5. Build the Maven Site using THIS repo's pom.xml + src/site/
83+
# 5. Update hardcoded version strings in site content
84+
# Cookbook files and other markdown pages embed JBang //DEPS lines with
85+
# hardcoded artifact versions for direct browsing on GitHub. Update them
86+
# to the version being released. (${project.version} references are
87+
# handled by Maven resource filtering during mvn site.)
88+
- name: Update version strings in site content
89+
run: |
90+
VERSION="${{ inputs.version }}"
91+
echo "Updating copilot-sdk-java version references to ${VERSION}"
92+
find src/site/markdown -name "*.md" -type f -exec \
93+
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" {} \;
94+
95+
# 6. Build the Maven Site using THIS repo's pom.xml + src/site/
8496
- name: Build documentation site
8597
run: |
8698
echo "Building site for version ${{ inputs.version }}"
8799
mvn site -Dsite.version=${{ inputs.version }} -B
88100
89-
# 6. Prepare gh-pages deployment directory
101+
# 7. Prepare gh-pages deployment directory
90102
- name: Prepare gh-pages directory
91103
run: |
92104
# Try to clone existing gh-pages branch (shallow)
@@ -100,7 +112,7 @@ jobs:
100112
git checkout -b gh-pages
101113
}
102114
103-
# 7. Copy generated site to version directory
115+
# 8. Copy generated site to version directory
104116
- name: Deploy version documentation
105117
run: |
106118
VERSION="${{ inputs.version }}"
@@ -117,13 +129,13 @@ jobs:
117129
cp -r target/site/* "site/latest/"
118130
fi
119131
120-
# 8. Copy version index page from templates
132+
# 9. Copy version index page from templates
121133
- name: Copy version index page
122134
run: |
123135
cp .github/templates/index.html site/index.html
124136
cp .github/templates/styles.css site/styles.css
125137
126-
# 9. Update version list based on directories present in gh-pages
138+
# 10. Update version list based on directories present in gh-pages
127139
- name: Update version list from deployed directories
128140
run: |
129141
cd site
@@ -168,7 +180,7 @@ jobs:
168180
sed -i "s|<!-- OLDER_VERSIONS_PLACEHOLDER -->|$OLDER_HTML|" index.html
169181
sed -i "s|<!-- COMMUNITY_VERSIONS_PLACEHOLDER -->|$COMMUNITY_HTML|" index.html
170182
171-
# 10. Overlay custom JaCoCo CSS
183+
# 11. Overlay custom JaCoCo CSS
172184
- name: Overlay custom JaCoCo CSS
173185
run: |
174186
cd site
@@ -182,7 +194,7 @@ jobs:
182194
done
183195
fi
184196
185-
# 11. Push to gh-pages
197+
# 12. Push to gh-pages
186198
- name: Deploy to GitHub Pages
187199
run: |
188200
cd site

src/site/markdown/cookbook/error-handling.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jbang BasicErrorHandling.java
3030

3131
**Code:**
3232
```java
33-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
33+
//DEPS com.github:copilot-sdk-java:1.0.0
3434
import com.github.copilot.CopilotClient;
3535
import com.github.copilot.generated.AssistantMessageEvent;
3636
import com.github.copilot.rpc.MessageOptions;
@@ -64,7 +64,7 @@ public class BasicErrorHandling {
6464
## Handling specific error types
6565

6666
```java
67-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
67+
//DEPS com.github:copilot-sdk-java:1.0.0
6868
import com.github.copilot.CopilotClient;
6969
import java.util.concurrent.ExecutionException;
7070

@@ -99,7 +99,7 @@ public class SpecificErrorHandling {
9999
## Timeout handling
100100

101101
```java
102-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
102+
//DEPS com.github:copilot-sdk-java:1.0.0
103103
import com.github.copilot.CopilotSession;
104104
import com.github.copilot.generated.AssistantMessageEvent;
105105
import com.github.copilot.rpc.MessageOptions;
@@ -130,7 +130,7 @@ public class TimeoutHandling {
130130
## Aborting a request
131131

132132
```java
133-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
133+
//DEPS com.github:copilot-sdk-java:1.0.0
134134
import com.github.copilot.CopilotSession;
135135
import com.github.copilot.rpc.MessageOptions;
136136
import java.util.concurrent.Executors;
@@ -162,7 +162,7 @@ public class AbortRequest {
162162
## Graceful shutdown
163163

164164
```java
165-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
165+
//DEPS com.github:copilot-sdk-java:1.0.0
166166
import com.github.copilot.CopilotClient;
167167

168168
public class GracefulShutdown {
@@ -192,7 +192,7 @@ public class GracefulShutdown {
192192
## Try-with-resources pattern
193193

194194
```java
195-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
195+
//DEPS com.github:copilot-sdk-java:1.0.0
196196
import com.github.copilot.CopilotClient;
197197
import com.github.copilot.generated.AssistantMessageEvent;
198198
import com.github.copilot.rpc.MessageOptions;
@@ -224,7 +224,7 @@ public class TryWithResources {
224224
## Handling tool errors
225225

226226
```java
227-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
227+
//DEPS com.github:copilot-sdk-java:1.0.0
228228
import com.github.copilot.CopilotClient;
229229
import com.github.copilot.generated.AssistantMessageEvent;
230230
import com.github.copilot.rpc.MessageOptions;

src/site/markdown/cookbook/managing-local-files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jbang ManagingLocalFiles.java
3434

3535
**Code:**
3636
```java
37-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
37+
//DEPS com.github:copilot-sdk-java:1.0.0
3838
import com.github.copilot.CopilotClient;
3939
import com.github.copilot.generated.AssistantMessageEvent;
4040
import com.github.copilot.generated.SessionIdleEvent;
@@ -161,7 +161,7 @@ session.send(new MessageOptions().setPrompt(prompt));
161161
## Interactive file organization
162162

163163
```java
164-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
164+
//DEPS com.github:copilot-sdk-java:1.0.0
165165
import java.io.BufferedReader;
166166
import java.io.InputStreamReader;
167167

src/site/markdown/cookbook/multiple-sessions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jbang MultipleSessions.java
3030

3131
**Code:**
3232
```java
33-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
33+
//DEPS com.github:copilot-sdk-java:1.0.0
3434
import com.github.copilot.CopilotClient;
3535
import com.github.copilot.generated.AssistantMessageEvent;
3636
import com.github.copilot.rpc.MessageOptions;
@@ -123,7 +123,7 @@ try {
123123
## Managing session lifecycle with CompletableFuture
124124

125125
```java
126-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
126+
//DEPS com.github:copilot-sdk-java:1.0.0
127127
import java.util.concurrent.CompletableFuture;
128128
import java.util.List;
129129

@@ -176,7 +176,7 @@ pool so that SDK work does not compete with the rest of your application for
176176
common-pool threads:
177177

178178
```java
179-
//DEPS com.github:copilot-sdk-java:${project.version}
179+
//DEPS com.github:copilot-sdk-java:1.0.0
180180
import com.github.copilot.CopilotClient;
181181
import com.github.copilot.rpc.CopilotClientOptions;
182182
import com.github.copilot.rpc.SessionConfig;

src/site/markdown/cookbook/persisting-sessions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jbang PersistingSessions.java
3030

3131
**Code:**
3232
```java
33-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
33+
//DEPS com.github:copilot-sdk-java:1.0.0
3434
import com.github.copilot.CopilotClient;
3535
import com.github.copilot.generated.AssistantMessageEvent;
3636
import com.github.copilot.rpc.MessageOptions;
@@ -127,7 +127,7 @@ public class DeleteSession {
127127
## Getting session history
128128

129129
```java
130-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
130+
//DEPS com.github:copilot-sdk-java:1.0.0
131131
import com.github.copilot.CopilotClient;
132132
import com.github.copilot.generated.AssistantMessageEvent;
133133
import com.github.copilot.generated.UserMessageEvent;
@@ -162,7 +162,7 @@ public class SessionHistory {
162162
## Complete example with session management
163163

164164
```java
165-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
165+
//DEPS com.github:copilot-sdk-java:1.0.0
166166
import java.util.Scanner;
167167

168168
public class SessionManager {

src/site/markdown/cookbook/pr-visualization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jbang PRVisualization.java github/copilot-sdk
3434
## Full example: PRVisualization.java
3535

3636
```java
37-
//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0
37+
//DEPS com.github:copilot-sdk-java:1.0.0
3838
import com.github.copilot.CopilotClient;
3939
import com.github.copilot.generated.AssistantMessageEvent;
4040
import com.github.copilot.generated.ToolExecutionStartEvent;

0 commit comments

Comments
 (0)