|
| 1 | +## Step 1: Help me modernize Copilot |
| 2 | + |
| 3 | +Welcome to Mergington High School's IT team! You've joined at a critical time. The school has been using the same COBOL-based accounting system since the early 1990s to manage student fees, cafeteria accounts, and school supplies purchases. The original programmer retired years ago, and the current IT staff struggles to maintain the system whenever changes are needed. |
| 4 | + |
| 5 | +### 📖 Theory: Educational Legacy Systems Modernization |
| 6 | + |
| 7 | +> [!NOTE] |
| 8 | +> Legacy code modernization in educational settings means transforming outdated systems into modern technologies while preserving essential school business operations and data integrity. |
| 9 | +
|
| 10 | +Many educational institutions still rely on legacy COBOL systems for critical administrative functions. While these systems have reliably managed school finances for decades, they now present significant challenges: |
| 11 | + |
| 12 | +- ❗ Skill Shortage – Fewer developers today know COBOL, making maintenance difficult and expensive. |
| 13 | +- ❗ Integration Issues – Legacy systems struggle to interface with modern platforms, APIs, and cloud services. |
| 14 | +- ❗ High Maintenance Costs – Old systems and inefficient processes drive up the cost of running and supporting legacy systems |
| 15 | +- ❗ Lack of Agility – Legacy systems are rigid, making it hard to adapt to new business needs or market changes quickly. |
| 16 | +- ❗ Security Risks – Outdated codebases may lack modern security features, leaving systems vulnerable. |
| 17 | + |
| 18 | +**Benefits of Modernizing Legacy Systems** |
| 19 | + |
| 20 | +- ✅ Improved Agility – Easier to adapt and scale with changing business and technology needs. |
| 21 | +- ✅ Cost Efficiency – Modern systems are typically more efficient and require less manual intervention. |
| 22 | +- ✅ Better Integration – Seamless connection with modern tools, APIs, and third-party services. |
| 23 | +- ✅ Enhanced Security – Up-to-date security protocols and compliance with modern standards. |
| 24 | +- ✅ Access to Talent – Easier to hire developers familiar with modern languages and tools. |
| 25 | + |
| 26 | +However, companies are often afraid of the initial steps to modernizing their legacy systems. |
| 27 | + |
| 28 | +GitHub Copilot can help breach that feat and transform this modernization process by: |
| 29 | + |
| 30 | +1. Helping decipher the decades-old COBOL code that lacks documentation. |
| 31 | +1. Assisting with test creation to ensure business logic remains intact. |
| 32 | +1. Translating COBOL structures to modern Node.js equivalents. |
| 33 | +1. Testing the new code to ensure it meets the original system's requirements. |
| 34 | + |
| 35 | +### ⌨️ Activity: Setting Up Your Environment |
| 36 | + |
| 37 | +To get started, we will set up a GitHub Codespace with the necessary tools and extensions to use GitHub Copilot effectively. |
| 38 | + |
| 39 | +> [!TIP] |
| 40 | +> You can learn more about current and upcoming features in the [GitHub Copilot Features](https://docs.github.com/en/copilot/about-github-copilot/github-copilot-features) documentation. |
| 41 | +
|
| 42 | +1. Right-click the below button to open the **Create Codespace** page in a new tab. Use the default configuration. |
| 43 | + |
| 44 | + [](https://codespaces.new/{{full_repo_name}}?quickstart=1) |
| 45 | + |
| 46 | +1. Confirm the **Repository** field is your copy of the exercise, not the original, then click the green **Create Codespace** button. |
| 47 | + |
| 48 | + - ✅ Your copy: `/{{full_repo_name}}` |
| 49 | + - ❌ Original: `/skills/modernize-your-legacy-code-with-github-copilot` |
| 50 | + |
| 51 | +1. Wait a moment for Visual Studio Code to load in your browser. |
| 52 | + |
| 53 | +1. In the left sidebar, click the extensions tab and verify that the `GitHub Copilot` and `Cobol` extensions are installed and enabled. |
| 54 | + |
| 55 | + <img width="350" alt="copilot extension for VS Code" src="https://github.com/user-attachments/assets/ef1ef984-17fc-4b20-a9a6-65a866def468" /> |
| 56 | + |
| 57 | + <img width="345" alt="cobol extension for VS Code" src="https://github.com/user-attachments/assets/955aad46-7468-4942-bbd3-d342bcef7642" /> |
| 58 | + |
| 59 | +1. At the top of VS Code, locate and click the **Copilot icon** to open a Copilot Chat panel. |
| 60 | + |
| 61 | + <img width="150" alt="image" src="https://github.com/user-attachments/assets/5e64db46-95cb-415d-badc-b6b8677f10c1" /> |
| 62 | + |
| 63 | +1. If this is your first time using GitHub Copilot, you will need to accept the usage terms to continue. |
| 64 | + |
| 65 | +<details> |
| 66 | +<summary>Having trouble? 🤷</summary><br/> |
| 67 | + |
| 68 | +- If you don't see the Copilot icon, make sure you have the GitHub Copilot extension installed and enabled. |
| 69 | +- If you don't see the Copilot chat panel or have other issues with it, try reloading the codespace with `Ctrl + Shift + P` (Windows) or `Cmd + Shift + P` (Mac) and selecting **Developer: Reload Window**. |
| 70 | + |
| 71 | +</details> |
| 72 | + |
| 73 | +### :keyboard: Activity: Use Copilot to help remember a terminal command 🙋 |
| 74 | + |
| 75 | +Great work! Now that we have our working environment set up, let's ask copilot for help starting a branch so we can do some refactoring in the next steps! |
| 76 | + |
| 77 | +1. In the bottom panel, select the **Terminal** tab. |
| 78 | + |
| 79 | +1. Within the new terminal window use the keyboard shortcut `Ctrl + I` (windows) or `Cmd + I` (mac) to bring up **Copilot's Terminal Inline Chat**. |
| 80 | + |
| 81 | +1. Let's ask Copilot to help us remember a command we have forgotten: creating a branch and publishing it. |
| 82 | + |
| 83 | + >  |
| 84 | + > |
| 85 | + > ```prompt |
| 86 | + > Hey copilot, how can I create and publish a new git branch called modernize-legacy-code? |
| 87 | + > ``` |
| 88 | +
|
| 89 | + <details> |
| 90 | + <summary>Having trouble? 🤷</summary><br/> |
| 91 | +
|
| 92 | + Remember, you are supposed to use **Copilot's Terminal Inline Chat** NOT the Copilot Chat panel. |
| 93 | +
|
| 94 | + The Terminal Inline Chat is specifically designed to help with terminal commands. |
| 95 | +
|
| 96 | + Copilot should respond with a command similar to the one below. |
| 97 | +
|
| 98 | + ```shell |
| 99 | + git checkout -b modernize-legacy-code |
| 100 | + git push -u origin modernize-legacy-code |
| 101 | + ``` |
| 102 | +
|
| 103 | + </details> |
| 104 | + |
| 105 | +1. Now that we are happy with the command, press the `Run` button to let Copilot run it for us. No need to copy and paste! |
| 106 | + |
| 107 | +1. Now that your branch is pushed to GitHub, Mona should already be busy checking your work. Give her a moment and keep watch in the comments. You will see her respond with progress info and the next lesson. |
| 108 | + |
| 109 | +<details> |
| 110 | +<summary>Having trouble? 🤷</summary><br/> |
| 111 | + |
| 112 | +If you don't get feedback, here are some things to check: |
| 113 | + |
| 114 | +- Make sure you created the branch with the **exact name** `modernize-legacy-code`. No prefixes or suffixes. |
| 115 | +- Make sure the branch was indeed pushed to your repository. That will trigger the next step. |
| 116 | +- If Copilot doesn't understand your command, try rephrasing it or providing more context. |
| 117 | + |
| 118 | +</details> |
0 commit comments