Skip to content

Commit a8d7218

Browse files
authored
Merge pull request #2 from copilot-dev-days/fix/workshop-instructions
Fix workshop instruction issues and surface CLI workshop on GitHub Pages
2 parents 46edeb4 + 5dc99a6 commit a8d7218

File tree

13 files changed

+376
-13
lines changed

13 files changed

+376
-13
lines changed

doc-media/create-skill.png

19.2 KB
Loading

docs/index.html

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
<h1>App Modernization with GitHub Copilot</h1>
2929
<p class="hero-subtitle">Modernize a legacy Java application using GitHub Copilot. Assess, upgrade frameworks, add health endpoints, and containerize — all with AI-powered assistance.</p>
3030
<div class="hero-cta">
31-
<a href="step.html?step=00-overview" class="btn btn-primary">🚀 Start Workshop</a>
31+
<a href="step.html?step=00-overview" class="btn btn-primary">🚀 Start IDE Workshop</a>
32+
<a href="step.html?variant=cli&step=00-overview" class="btn btn-primary">🖥️ Start CLI Workshop</a>
3233
<a href="https://github.com/copilot-dev-days/appmod-workshop-java" class="btn btn-secondary" target="_blank">⭐ GitHub Repo</a>
3334
</div>
3435
<div class="stats">
@@ -78,7 +79,7 @@ <h3>Containerization</h3>
7879

7980
<section class="workshop">
8081
<div class="container">
81-
<h2 class="section-title">Workshop Parts</h2>
82+
<h2 class="section-title">IDE Workshop (VS Code / IntelliJ)</h2>
8283
<div class="parts-list">
8384
<a href="step.html?step=00-overview" class="part-card">
8485
<div class="part-number">📚</div>
@@ -139,6 +140,62 @@ <h3>Copilot Prompts Guide</h3>
139140
</div>
140141
</section>
141142

143+
<section class="workshop">
144+
<div class="container">
145+
<h2 class="section-title">CLI Workshop (Terminal / No IDE)</h2>
146+
<div class="parts-list">
147+
<a href="step.html?variant=cli&step=00-overview" class="part-card">
148+
<div class="part-number">📚</div>
149+
<div class="part-content">
150+
<h3>Workshop Overview</h3>
151+
<p>What you'll build, learn, and time estimates</p>
152+
</div>
153+
<span class="part-time">5 min</span>
154+
</a>
155+
<a href="step.html?variant=cli&step=01-prerequisites" class="part-card">
156+
<div class="part-number">01</div>
157+
<div class="part-content">
158+
<h3>Prerequisites & Setup</h3>
159+
<p>Install Copilot CLI, Node.js 22+, and required tools</p>
160+
</div>
161+
<span class="part-time">5 min</span>
162+
</a>
163+
<a href="step.html?variant=cli&step=02-assess" class="part-card">
164+
<div class="part-number">02</div>
165+
<div class="part-content">
166+
<h3>Start Copilot CLI</h3>
167+
<p>Launch Copilot CLI and add the MCP modernization server</p>
168+
</div>
169+
<span class="part-time">5 min</span>
170+
</a>
171+
<a href="step.html?variant=cli&step=03-upgrade" class="part-card">
172+
<div class="part-number">03</div>
173+
<div class="part-content">
174+
<h3>Upgrade Runtime & Frameworks</h3>
175+
<p>Upgrade Java 8→21 and Spring Boot 2.x→3.x via natural language</p>
176+
</div>
177+
<span class="part-time">10 min</span>
178+
</a>
179+
<a href="step.html?variant=cli&step=04-health-endpoints" class="part-card">
180+
<div class="part-number">04</div>
181+
<div class="part-content">
182+
<h3>Health Endpoints</h3>
183+
<p>Add health endpoints using a natural language prompt</p>
184+
</div>
185+
<span class="part-time">10 min</span>
186+
</a>
187+
<a href="step.html?variant=cli&step=05-containerize" class="part-card">
188+
<div class="part-number">05</div>
189+
<div class="part-content">
190+
<h3>Containerize Applications</h3>
191+
<p>Generate Dockerfiles via natural language prompt</p>
192+
</div>
193+
<span class="part-time">5 min</span>
194+
</a>
195+
</div>
196+
</div>
197+
</section>
198+
142199
<section class="prereqs">
143200
<div class="container">
144201
<h2 class="section-title">Prerequisites</h2>

docs/step.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="layout">
3939
<aside class="sidebar">
4040
<div class="sidebar-section">
41-
<div class="sidebar-title">Workshop Steps</div>
41+
<div class="sidebar-title" id="sidebarTitle">Workshop Steps</div>
4242
<nav id="stepNav"></nav>
4343
</div>
4444
</aside>
@@ -54,7 +54,7 @@
5454
</div>
5555

5656
<script>
57-
const steps = [
57+
const ideSteps = [
5858
{ id: '00-overview', file: 'workshop/00-overview.md', title: 'Workshop Overview', number: '📚' },
5959
{ id: '01-prerequisites', file: 'workshop/01-prerequisites.md', title: 'Prerequisites & Setup', number: '01' },
6060
{ id: '02-assess', file: 'workshop/02-assess.md', title: 'Assess Your Application', number: '02' },
@@ -64,6 +64,24 @@
6464
{ id: 'prompts', file: 'PROMPTS.md', title: 'Copilot Prompts Guide', number: '📖' },
6565
];
6666

67+
const cliSteps = [
68+
{ id: '00-overview', file: 'workshop-cli/00-overview.md', title: 'Workshop Overview', number: '📚' },
69+
{ id: '01-prerequisites', file: 'workshop-cli/01-prerequisites.md', title: 'Prerequisites & Setup', number: '01' },
70+
{ id: '02-assess', file: 'workshop-cli/02-assess.md', title: 'Start Copilot CLI', number: '02' },
71+
{ id: '03-upgrade', file: 'workshop-cli/03-upgrade.md', title: 'Upgrade Runtime & Frameworks', number: '03' },
72+
{ id: '04-health-endpoints', file: 'workshop-cli/04-health-endpoints.md', title: 'Health Endpoints', number: '04' },
73+
{ id: '05-containerize', file: 'workshop-cli/05-containerize.md', title: 'Containerize Applications', number: '05' },
74+
];
75+
76+
function getVariant() {
77+
const params = new URLSearchParams(window.location.search);
78+
return params.get('variant') === 'cli' ? 'cli' : 'ide';
79+
}
80+
81+
const variant = getVariant();
82+
const steps = variant === 'cli' ? cliSteps : ideSteps;
83+
const variantParam = variant === 'cli' ? 'variant=cli&' : '';
84+
6785
const isLocal = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' || window.location.protocol === 'file:';
6886
const GITHUB_RAW_BASE = isLocal ? '../' : 'https://raw.githubusercontent.com/copilot-dev-days/appmod-workshop-java/main/';
6987

@@ -76,8 +94,9 @@
7694

7795
function buildSidebar() {
7896
const nav = document.getElementById('stepNav');
97+
document.getElementById('sidebarTitle').textContent = variant === 'cli' ? 'CLI Workshop Steps' : 'Workshop Steps';
7998
nav.innerHTML = steps.map((step, i) => `
80-
<a href="?step=${step.id}" class="step-link ${i === currentIndex ? 'active' : ''}" data-index="${i}">
99+
<a href="?${variantParam}step=${step.id}" class="step-link ${i === currentIndex ? 'active' : ''}" data-index="${i}">
81100
<span class="step-number">${step.number}</span>
82101
<span>${step.title}</span>
83102
</a>
@@ -94,15 +113,15 @@
94113
const prev = currentIndex > 0 ? steps[currentIndex - 1] : null;
95114
const next = currentIndex < steps.length - 1 ? steps[currentIndex + 1] : null;
96115
footer.innerHTML = `
97-
<a href="${prev ? '?step=' + prev.id : '#'}" class="nav-footer-btn ${!prev ? 'disabled' : ''}">← ${prev ? prev.title : 'Previous'}</a>
98-
<a href="${next ? '?step=' + next.id : '#'}" class="nav-footer-btn ${!next ? 'disabled' : ''}">${next ? next.title : 'Next'} →</a>
116+
<a href="${prev ? '?' + variantParam + 'step=' + prev.id : '#'}" class="nav-footer-btn ${!prev ? 'disabled' : ''}">← ${prev ? prev.title : 'Previous'}</a>
117+
<a href="${next ? '?' + variantParam + 'step=' + next.id : '#'}" class="nav-footer-btn ${!next ? 'disabled' : ''}">${next ? next.title : 'Next'} →</a>
99118
`;
100119
}
101120

102121
function navigate(direction) {
103122
const newIndex = currentIndex + direction;
104123
if (newIndex >= 0 && newIndex < steps.length) {
105-
window.location.href = `?step=${steps[newIndex].id}`;
124+
window.location.href = `?${variantParam}step=${steps[newIndex].id}`;
106125
}
107126
}
108127

workshop-cli/00-overview.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# App Modernization Workshop (Copilot CLI)
2+
3+
## Overview
4+
5+
This workshop will walk you through the process of modernizing a Java application using **GitHub Copilot app modernization via the Copilot CLI**. You'll transform the `asset-manager` project from legacy technologies to a modern, cloud-ready solution — entirely from your terminal, with no IDE required.
6+
7+
**What the Modernization Process Will Do:**
8+
9+
The modernization will transform your application from outdated technologies to a modern solution. This includes:
10+
- Upgrading from **Java 8 to Java 21**
11+
- Migrating from **Spring Boot 2.x to 3.x**
12+
- Adding **health check endpoints**
13+
- **Containerizing** the applications
14+
15+
## Time Estimates
16+
17+
The complete workshop takes approximately **35 minutes** to complete:
18+
19+
| Step | Duration |
20+
|------|----------|
21+
| Prerequisites & Setup | ~5 min |
22+
| Start Copilot CLI & Add MCP Server | ~5 min |
23+
| Upgrade Runtime & Frameworks | ~10 min |
24+
| Expose Health Endpoints | ~10 min |
25+
| Containerize Applications | ~5 min |
26+
27+
## Workshop Steps
28+
29+
| Step | Title | Description |
30+
|------|-------|-------------|
31+
| 01 | [Prerequisites & Setup](01-prerequisites.md) | Install tools and clone the repository |
32+
| 02 | [Start Copilot CLI](02-assess.md) | Launch Copilot CLI and add the modernization MCP server |
33+
| 03 | [Upgrade Runtime & Frameworks](03-upgrade.md) | Upgrade Java and Spring Boot versions |
34+
| 04 | [Health Endpoints](04-health-endpoints.md) | Expose health endpoints using a natural language prompt |
35+
| 05 | [Containerize Applications](05-containerize.md) | Prepare your app for cloud deployment |
36+
37+
## What You'll Learn
38+
39+
- How to use **GitHub Copilot CLI** to modernize legacy Java applications from the terminal
40+
- How to configure the **GitHub Copilot modernization MCP server**
41+
- How to upgrade Java versions and Spring Boot frameworks with AI assistance using natural language prompts
42+
- How to containerize Java applications for cloud deployment

workshop-cli/01-prerequisites.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Step 1: Prerequisites & Setup
2+
3+
## Prerequisites
4+
5+
- A GitHub account with [GitHub Copilot](https://github.com/features/copilot) enabled. A Pro, Pro+, Business, or Enterprise plan is required.
6+
7+
> [!NOTE]
8+
> If you receive Copilot through an organization, the Copilot CLI policy must be enabled in the organization's settings.
9+
10+
- [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) installed and authenticated.
11+
- [Node.js](https://nodejs.org/) version 22 or later.
12+
- [npm](https://www.npmjs.com/get-npm) version 10 or later.
13+
- [Java JDK](https://learn.microsoft.com/java/openjdk/download) for both the source and target JDK versions.
14+
- [Maven](https://maven.apache.org/download.cgi) or [Gradle](https://gradle.org/install/) to build Java projects.
15+
- A Git-managed Java project using Maven or Gradle.
16+
- For Maven-based projects: access to the public Maven Central repository.
17+
18+
> [!NOTE]
19+
> If you're using Gradle, only the Gradle wrapper version 5+ is supported. The Kotlin Domain Specific Language (DSL) isn't supported.
20+
21+
## Clone the Repository
22+
23+
```bash
24+
git clone https://github.com/copilot-dev-days/appmod-workshop-java.git
25+
cd appmod-workshop-java
26+
```
27+
28+
## Install GitHub Copilot CLI
29+
30+
Follow the official instructions to install and authenticate the GitHub Copilot CLI:
31+
32+
1. Install the CLI by following [Install GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli).
33+
2. Authenticate with your GitHub account by running:
34+
```bash
35+
gh auth login
36+
```
37+
3. Verify the CLI is working:
38+
```bash
39+
copilot --version
40+
```
41+
42+
## ✅ Checkpoint
43+
44+
- [ ] GitHub Copilot CLI installed and authenticated
45+
- [ ] Node.js 22+ and npm 10+ installed
46+
- [ ] Repository cloned locally
47+
- [ ] Java JDK and Maven installed

workshop-cli/02-assess.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Step 2: Start Copilot CLI
2+
3+
## 🎯 Goal
4+
5+
Launch the GitHub Copilot CLI from the project directory and add the GitHub Copilot modernization MCP server so you can run modernization tasks using natural language.
6+
7+
## Start Copilot CLI
8+
9+
1. In your terminal, navigate to the root of the cloned repository:
10+
11+
```bash
12+
cd appmod-workshop-java
13+
```
14+
15+
2. Start the Copilot CLI:
16+
17+
```bash
18+
copilot
19+
```
20+
21+
3. Copilot asks you to confirm that you trust the files in this folder. Choose one of the following:
22+
- **Yes, proceed** — Copilot can work with files in this location for this session only.
23+
- **Yes, and remember this folder for future sessions** — Trust this folder for this and all future sessions.
24+
- **No, exit (Esc)** — End the session.
25+
26+
For this workshop, select **Yes, proceed**.
27+
28+
## Add the Modernization MCP Server
29+
30+
4. Add the GitHub Copilot modernization MCP server by running the following command inside Copilot CLI:
31+
32+
```
33+
/mcp add app-modernization
34+
```
35+
36+
This installs and registers the `@microsoft/github-copilot-app-modernization-mcp-server` package.
37+
38+
> [!TIP]
39+
> Alternatively, you can manually add the server by editing `~/copilot/mcp-config.json`:
40+
> ```json
41+
> {
42+
> "mcpServers": {
43+
> "app-modernization": {
44+
> "type": "local",
45+
> "command": "npx",
46+
> "tools": ["*"],
47+
> "args": ["-y", "@microsoft/github-copilot-app-modernization-mcp-server"]
48+
> }
49+
> }
50+
> }
51+
> ```
52+
53+
5. Verify the MCP server is correctly configured:
54+
55+
```
56+
/mcp show
57+
```
58+
59+
You should see `app-modernization` listed as an active MCP server.
60+
61+
## ✅ Checkpoint
62+
63+
- [ ] Copilot CLI started from the repository root
64+
- [ ] Folder trust confirmed
65+
- [ ] `app-modernization` MCP server added with `/mcp add`
66+
- [ ] MCP server verified with `/mcp show`

workshop-cli/03-upgrade.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Step 3: Upgrade Runtime & Frameworks
2+
3+
## 🎯 Goal
4+
5+
Upgrade the application from Java 8 to Java 21 and from Spring Boot 2.x to 3.x by running a natural language prompt in the Copilot CLI.
6+
7+
## Run the Java Upgrade
8+
9+
1. Inside the running Copilot CLI session, enter the following prompt:
10+
11+
```
12+
Upgrade this project to JDK 21 and Spring Boot 3.2
13+
```
14+
15+
2. Copilot will begin the upgrade process. This includes:
16+
- Generating an upgrade plan
17+
- Performing code remediation
18+
- Building the project
19+
- Checking for vulnerabilities
20+
21+
Allow Copilot to proceed through each step. The task runs end-to-end and displays progress in the terminal.
22+
23+
3. When the task completes, an upgrade summary is displayed showing everything that was changed.
24+
25+
## What the Upgrade Does
26+
27+
The automated upgrade will:
28+
- Update the Java version in `pom.xml` from 8 to 21
29+
- Upgrade Spring Boot dependencies from 2.x to 3.x
30+
- Update incompatible APIs (e.g., `javax.*``jakarta.*` namespace changes)
31+
- Fix deprecated method calls and patterns
32+
- Update Maven plugin versions as needed
33+
34+
> [!NOTE]
35+
> You can target a different Java version by adjusting the prompt. For example: `Upgrade this project to JDK 25 and Spring Boot 3.x`.
36+
37+
## Review the Changes
38+
39+
After the upgrade completes:
40+
1. Review the git diff to see all changes made
41+
2. Verify that `pom.xml` reflects the new Java and Spring Boot versions
42+
3. Check that namespace changes (`javax``jakarta`) have been applied
43+
44+
## ✅ Checkpoint
45+
46+
- [ ] Upgrade prompt executed in Copilot CLI
47+
- [ ] Upgrade task completed successfully
48+
- [ ] Java version updated to 21 in `pom.xml`
49+
- [ ] Spring Boot upgraded to 3.x
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Step 4: Expose Health Endpoints
2+
3+
## 🎯 Goal
4+
5+
Use a natural language prompt in Copilot CLI to add Spring Boot Actuator health endpoints to your application.
6+
7+
## Run the Health Endpoint Task
8+
9+
1. Inside the running Copilot CLI session, enter the following prompt:
10+
11+
```
12+
Add Spring Boot Actuator health endpoints to this project for Azure Container Apps deployment readiness. Follow the Spring Boot Actuator documentation at https://docs.spring.io/spring-boot/reference/actuator/endpoints.html
13+
```
14+
15+
2. Copilot will analyze the project and perform the necessary changes. Allow Copilot to proceed through each step.
16+
17+
3. When the task completes, review the changes in the terminal output.
18+
19+
## What This Does
20+
21+
The task will:
22+
- Add the Spring Boot Actuator dependency to `pom.xml`
23+
- Configure health endpoints in `application.properties` or `application.yml`
24+
- Expose `/actuator/health` endpoint for Azure Container Apps health probes
25+
- This is essential for cloud deployment where the platform needs to check if your app is healthy
26+
27+
> [!TIP]
28+
> You can customize the prompt further. For example, you can ask Copilot to expose additional actuator endpoints such as `/actuator/info` or `/actuator/metrics`.
29+
30+
## ✅ Checkpoint
31+
32+
- [ ] Health endpoint prompt executed in Copilot CLI
33+
- [ ] Spring Boot Actuator dependency added to `pom.xml`
34+
- [ ] Health endpoint configured in `application.properties` or `application.yml`
35+
- [ ] `/actuator/health` endpoint will be available when the app runs

0 commit comments

Comments
 (0)