UMM-CSci-3601 / 3601-iteration-template

This template repository is used as a starting point for course projects in CSci 3601: Software Design and Development at the University of Minnesota Morris. It includes an Angular client along with a Javalin server and Mongo database.
MIT License
0 stars 9 forks source link

Document the use of GitHub CoPilot #1390

Open NicMcPhee opened 6 months ago

NicMcPhee commented 6 months ago

I think it's important to acknowledge that these tools exist and talk in the class about how we might use them. GitHub CoPilot should be free for the students via the Student Pack, so I figure that's the tool to go with for now.

We probably need to document

The last one will be fairly speculative since we're making this up as we go along, but at a minimum emphasizing the need to read and make sense of whatever it proposes instead of just blindly merging in code from CoPilot.

As examples, I used CoPilot to make suggestions for improving the test coverage by adding tests in #1366 and #1369. I was able to use CoPilot's suggestion in #1366 almost "as is", but the suggestion for #1369 required a fair bit of fiddling to get it to work.

This is definitely something that would be good "group project" as there are several parts and it would be good to get student feedback. If you try out CoPilot and have thoughts or experiences to share, please add them as comments to this issue (or to the associated PR when that gets created).

willster000 commented 6 months ago

I was able to set up co-pilot on my windows laptop through the following steps (I'm sure there's a simpler way to do this it isn't too bad):

  1. Open VS code
  2. Click the "View" tab up top
  3. Click the "Extensions" option
  4. Search for CoPilot
  5. Click "Install"
  6. Reload VS Code
  7. Click on the CoPilot icon in the bar at the bottom of VS Code (the little face with goggles)
  8. Click on the "GitHub CoPilot Chat" option
  9. Follow the prompt to login to GitHub
  10. I forget if I clicked through anything on GitHub at this point... if so, it was pretty self explanatory
  11. The chat-box icon should now appear in the left sidebar of VS Code. You can ask the AI questions here or receive suggestions while editing files.
NicMcPhee commented 6 months ago

Actually, I doubt there's anything a lot shorter than this, TBH. Would you (or anyone) be willing to turn this into a new github-copilot.md file in the repo?

(We're starting to get quite a few of those, so maybe we want a docs directory?)

willster000 commented 6 months ago

I'm happy to create a PR for a docs directory with the new github-copilot.md but before doing so, it would bring me peace of mind if someone who hasn't set it up (maybe Chenfei or Jaydon?) could try using my steps and especially see if there are any steps to be added at step 10 where I forgot exactly what I did.

NicMcPhee commented 6 months ago

Actually, @willster000 go ahead and write up your PR, and then one or both of them can try to follow that write-up. We're running out of time on all this, so it's probably best to press forward rather than wait on other folks.

kklamberty commented 6 months ago

I was able to set up co-pilot on my windows laptop through the following steps (I'm sure there's a simpler way to do this it isn't too bad):

1. Open VS code

2. Click the "View" tab up top

3. Click the "Extensions" option

4. Search for CoPilot

Several things come up, so we should specify what they ought to select. I assume "GitHub Copilot" is the extension to choose.

5. Click "Install"

Mine jumped to number 8 at this point (I didn't have to reload before the prompt appeared). But, I was also able to make the prompt appear in the way you describe, which is probably better than relying upon what may be different for others. If it didn't appear, your way still allows them to make it appear. It might make sense to make it clearer that if it doesn't appear, one should reload?

6. Reload VS Code

7. Click on the CoPilot icon in the bar at the bottom of VS Code (the little face with goggles)

8. Click on the "GitHub CoPilot Chat" option

9. Follow the prompt to login to GitHub

I logged in, but I was prompted that I need to sign up for CoPilot. Subsequently (before adding anything or signing up for anything) I see a button for a 30-day free trial, and I'm guessing that's not a good thing for me. I want it to use my education credentials, right? So, I closed VS Code and opened GitHub in my browser. Image 1-6-24 at 4 38 PM

10. _I forget if I clicked through anything on GitHub at this point... if so, it was pretty self explanatory_

A choice needs to be made about whether or not to allow suggestions from public code and whether or not to uncheck the box that is pre-checked to allow GitHub to use your code in public suggestions. Should we say what we did or leave that up to students? Image 1-6-24 at 4 39 PM

Image 1-6-24 at 4 41 PM

11. The chat-box icon should now appear in the left sidebar of VS Code. You can ask the AI questions here or receive suggestions while editing files.

Image 1-6-24 at 4 50 PM

kklamberty commented 6 months ago

@willster000 - does this help?

NicMcPhee commented 6 months ago

@kklamberty : Thanks so much for going through this in such detail!

I'd forgotten about the questions about sharing your code with Co-Pilot and using public code, etc., and I'm not sure what we want to do there.

At some level I feel like whether to share their code should be up to the student(s), but I'm not sure whether they can practically do it on an individual basis. If Chris chooses not to share, but Pat does, and then Pat ends up working with code Chris wrote, it'll end up in the system regardless.

Is this something the folks in the class should discuss and reach some kind of shared agreement on? Do we need everyone to be OK with sharing in order for anyone to be OK with sharing?

Does the same thing apply to the question of whether to use public code? If Chris chooses to use public code when Pat would prefer not to, when Chris's work will likely bring that code into the project "against Pat's wishes".

Note also that these are "global" settings, and most students will probably never come back and change them after the class is over.

Thoughts?

willster000 commented 6 months ago

From the little I read about the issue of using public code that co-pilot lifts from github, it sounds like there are complicated and unresolved legal and ethical issues at play. Given this, maybe its best to communicate these issues and then do an anonymous survey. If anyone doesn't want to use public code on copilot, you could ask if they're okay with working with others who do. If they're not and there's nobody else to work with then don't let anyone use public code on copilot? Just a thought.

NicMcPhee commented 6 months ago

A very reasonable thought. Do you still have links to what you read on this? It would be good if we could give them some resources to look at so they can make informed decisions.

willster000 commented 6 months ago

https://fossa.com/blog/analyzing-legal-implications-github-copilot/ https://www.kolide.com/blog/github-copilot-isn-t-worth-the-risk

willster000 commented 5 months ago

Sorry for taking a while with this. Pretty busy now that school is underway. Here is something you could give students to set up CoPilot if you haven't covered that already.

These steps walk you through how to set up GitHub Copilot in VS Code. Copilot is an AI tool which can make suggestions as you code or which you can chat with much in the same way as ChatGPT while referencing specific parts of your code.

  1. Go to GitHub
  2. Click on your profile
  3. Click on the "Copilot" option
  4. Follow prompts* to set up Copilot for free as a student
  5. Open VS code
  6. Click the "View" tab up top
  7. Click the "Extensions" option
  8. Search for and click on "GitHub Copilot"
  9. Click "Install"
  10. If you have the option to click on "GitHub Copilot Chat", do so and go to step 10
  11. If not, reload VS Code
  12. Click on the CoPilot icon in the bar at the bottom of VS Code (the little face with goggles)
  13. Click on the "GitHub CoPilot Chat" option
  14. Follow the prompt to login to GitHub
  15. You should now be able to chat with and receive suggestions from Copilot