Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
On branch edburns/dd-2758073-0.2.1
modified:   .github/workflows/publish-maven.yml
modified:   src/site/markdown/cookbook/error-handling.md
modified:   src/site/markdown/cookbook/managing-local-files.md
modified:   src/site/markdown/cookbook/multiple-sessions.md
modified:   src/site/markdown/cookbook/persisting-sessions.md
modified:   src/site/markdown/cookbook/pr-visualization.md

@Copilot wrote:

> The //DEPS ...:${project.version} placeholder is only replaced when the Maven Site filtering runs. When viewing this cookbook page directly on GitHub (README links to src/site/markdown/cookbook/), ${project.version} won’t be substituted, so the copy/paste JBang snippet won’t resolve. Consider either keeping a concrete version in the cookbook sources, or updating the README to point readers to the generated site cookbook pages (where filtering occurs).

Signed-off-by: Ed Burns <edburns@microsoft.com>
  • Loading branch information
edburns committed Mar 25, 2026
commit d94cd144b16da93a1295e8f993b71d5fa7efcd33
5 changes: 2 additions & 3 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ jobs:
# Update version in jbang-example.java
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" jbang-example.java

# Update version in cookbook files (Maven will filter ${project.version} during site generation,
# but we also need the actual version for direct JBang usage)
# Update version in cookbook files (hardcoded for direct GitHub browsing and JBang usage)
find src/site/markdown/cookbook -name "*.md" -type f -exec \
sed -i "s|\${project.version}|${VERSION}|g" {} \;
sed -i "s|copilot-sdk-java:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}|copilot-sdk-java:${VERSION}|g" {} \;
Comment thread
edburns marked this conversation as resolved.

# Commit the documentation changes before release:prepare (requires clean working directory)
git add CHANGELOG.md README.md jbang-example.java src/site/markdown/cookbook/
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/cookbook/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang BasicErrorHandling.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class BasicErrorHandling {
## Handling specific error types

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import java.util.concurrent.ExecutionException;

Expand Down Expand Up @@ -99,7 +99,7 @@ public class SpecificErrorHandling {
## Timeout handling

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotSession;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -130,7 +130,7 @@ public class TimeoutHandling {
## Aborting a request

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotSession;
import com.github.copilot.sdk.json.MessageOptions;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -162,7 +162,7 @@ public class AbortRequest {
## Graceful shutdown

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;

public class GracefulShutdown {
Expand Down Expand Up @@ -192,7 +192,7 @@ public class GracefulShutdown {
## Try-with-resources pattern

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -224,7 +224,7 @@ public class TryWithResources {
## Handling tool errors

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/cookbook/managing-local-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jbang ManagingLocalFiles.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.events.SessionIdleEvent;
Expand Down Expand Up @@ -161,7 +161,7 @@ session.send(new MessageOptions().setPrompt(prompt));
## Interactive file organization

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import java.io.BufferedReader;
import java.io.InputStreamReader;

Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/cookbook/multiple-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang MultipleSessions.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -123,7 +123,7 @@ try {
## Managing session lifecycle with CompletableFuture

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import java.util.concurrent.CompletableFuture;
import java.util.List;

Expand Down
6 changes: 3 additions & 3 deletions src/site/markdown/cookbook/persisting-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jbang PersistingSessions.java

**Code:**
```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.json.MessageOptions;
Expand Down Expand Up @@ -127,7 +127,7 @@ public class DeleteSession {
## Getting session history

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.events.UserMessageEvent;
Expand Down Expand Up @@ -162,7 +162,7 @@ public class SessionHistory {
## Complete example with session management

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import java.util.Scanner;

public class SessionManager {
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/cookbook/pr-visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jbang PRVisualization.java github/copilot-sdk
## Full example: PRVisualization.java

```java
//DEPS com.github:copilot-sdk-java:${project.version}
//DEPS com.github:copilot-sdk-java:0.1.32-java.0
import com.github.copilot.sdk.CopilotClient;
import com.github.copilot.sdk.events.AssistantMessageEvent;
import com.github.copilot.sdk.events.ToolExecutionStartEvent;
Expand Down