Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course Automation: Implementation of MPR shell script #1654

Merged
merged 15 commits into from
Apr 5, 2022
Merged

Conversation

luuuk
Copy link

@luuuk luuuk commented Apr 1, 2022

Assignment Submission

Title

Add a shell script (mpr, for "make pull request") which when invoked from CLI creates a new PR for students to the
devops course repository. This script will live in a new directory (/scripts) in the root of the devops repo.

Names and KTH ID

Deadline

Task 2

Category

Course Automation

Description

mpr simplifies the PR creation flow for students. This shell script incorporates pushing the most recent commit
to its remote branch in the forked repo copy, opens a new PR in the devops repo, and applies the template PR
Description.

Students will be able to run mpr from their command line, which will prompt them for a PR title. After they write the
title and hit enter, the script will run some git commands and open up the "create pull request" web UI with the
template for the title auto-filled based on the CLI input. Students will still need to update the description of the PR
with details from their readme, but this will simplify the PR creation process for students (
currently local commit, remote push, edit PR through git web UI, input title and desc, create pr, will
be local commit, mpr, input desc, create pr)

Demo video below (Sorry about the quality, Github has a 10mb size limit)!

MPR.V2.Demo.480.mov

Submission:
Shell Script URL in Standalone Repository: https://github.com/luuuk/devops-course/blob/2022/scripts/mpr.sh

@luuuk
Copy link
Author

luuuk commented Apr 1, 2022

@khaes-kth tagging you here since you reviewed my proposal for this task and have the contextual understanding. A number of the elements in the PR description don't match up well with this deliverable (since it is a submission to the devops repo). Let me know if there's anything else you want to see here, either in terms of documentation of the script functionality or additional implemented functionality!

@khaes-kth
Copy link

This is very cool!

You can even improve it further by asking for more info from the user, and put it in the PR format properly. Also, if you can help the user (student) create the README file in the right place, that would be good. For example, you get the team members KTH ID and names as well as the path to the readme file and then put the readme file into the right directory (with the name of team members).

Also, please do not include the script in this PR. Your submission PR can update the README and add a link to your script, which should be saved in a separate repo. In future, if teachers decide we will ask you to create a PR to add the script to KTH/devops-course repo.

@luuuk
Copy link
Author

luuuk commented Apr 1, 2022

Hey Khashayar - I agree that there is potential for a bit more utility with this script, but want to clarify a couple of points before I try to implement your suggestions.

  1. I totally agree that your suggestion about collecting info in the script and auto-filling the PR body would be a massive value add. However, one thing to consider is that the way the script currently is implemented (using open to load the compare screen) means that all this collected info would have to be formatted locally and appended to the URL's body parameter a very long string. This wouldn't necessarily be hard to implement but would make the URL pretty clunky for students.

  2. I envisionmpr as the second-to-last step in the student workflow for submissions. Thus, I'm not so sure that your suggestion about creating the README in the right location makes sense as a part of this script, since that is work that should have been done well before a student tries to open their PR. However, I think adding this as a local linting step before opening the PR might be a compromise that makes more sense (essentially checking that the README is correctly formatted)?

  3. Happy to put the script in my own repo for now, but do want to call out that pretty much all the utility in this script comes from it being included in forked copies of the main DevOps repo. It's not my call to make, but I would strongly suggest that the script is merged to the main repo in the near future so that other students can start using it for their WIP!

@khaes-kth
Copy link

Hi @luuuk

Good points. Regarding 1 and 2: that's your choice. I thought adding some functionalities to this script can make it more helpful for students and also make it more likely that Martin and Benoit will accept this contribution without requiring more changes.

Regarding point 3, I should say that we usually merge the scripts for next year version of the course. So, it is better if you put it in your own repo for now.

@luuuk
Copy link
Author

luuuk commented Apr 5, 2022

Sounds good @khaes-kth - I've implemented the auto-population of the PR body based on README content, but decided against the formatting checks. I'll put it in my own repo and update this PR to reflect the desired submission flow!

@khaes-kth
Copy link

Great, this seems good to me.

Is it ready to be merged?

@luuuk
Copy link
Author

luuuk commented Apr 5, 2022

Yep - ready to merge as long as the way I did the submission looks good to you (With the link added to the repo)!

@khaes-kth
Copy link

Do you have a readme for your script? If not, can you please add it somewhere in your repo? (ex., it can be here: https://github.com/luuuk/devops-course/tree/2022/scripts)

The readme can tell us how to run it, at least with the most simple config.

@luuuk
Copy link
Author

luuuk commented Apr 5, 2022

The script itself has an optional -h flag, which prints a message for the user with information, but will add a readme as well!

@luuuk
Copy link
Author

luuuk commented Apr 5, 2022

Supporting readme documentation is pushed to standalone repo @khaes-kth

@khaes-kth khaes-kth self-assigned this Apr 5, 2022
@khaes-kth khaes-kth added final_submission The final submission of a task course_automation labels Apr 5, 2022
Copy link

@khaes-kth khaes-kth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@khaes-kth khaes-kth merged commit d178aa3 into KTH:2022 Apr 5, 2022
@luuuk luuuk deleted the mpr branch April 6, 2022 06:59
Eyskha added a commit to Eyskha/devops-course that referenced this pull request Apr 6, 2022
* Executable tutorial: How to automate E2E-testing in React & Jest, using Github actions. (KTH#1589)

* Project proposal for Executable tutorial

* fix: renamed itle

* doc: Add readme for the task (KTH#1591)

* Added README.md for Project Proposal (KTH#1588)

* Added README.md for Project Proposal (KTH#1590)

Co-authored-by: Johanna Loev <jolov@kth.se>

* Presentation Proposal: Optimization Strategies for Test Suite Runtimes in Large Software Applications (KTH#1573)

* Project proposal

* Project proposal

* Move readme to correct location

* Rename proposal dir

* Rename proposal dir

* Rename proposal dir

* Small format change

* Small format change

* Small format change

* Small format change

Co-authored-by: Luke LeVasseur <llevasseur@flexport.com>

* Presentation Proposal: gatien-myechui (KTH#1597)

* Executable Tutotial: Adding bugs to code to evaluate tests Using Stryker Mutator in JS (KTH#1575)

* feat: test

* feat: first proporsal

* feat: first proporsal

* demo proposal: Automated embedded testing of FreeRTOS using Jenkins and AWS (KTH#1578)

* assignment proposal: demonstration for week1: testing & continuous integration

* Rename markdown file

* not ignoring cases anymore

* fix titles

* Delete Readme.md

* put proposal inside week folder

* fix schema

* Update README.md

* Update README.md

* Open source proposal: enhancement of embedded Rust libraries (testing) (KTH#1587)

* open source proposal: embedded rust libraries

* changed email email

* added missing assignment

* Demo proposal - Real-Time testing of a video game (KTH#1581)

* Add README for demo

* moved the readme

* fixed readme

* Demo: Testing frameworks for JavaScript in frontend and backend (KTH#1594)

* added our demo proposal

* modified demo proposal

* Weekly schedules

We'll update the schedule for presentations and demos here

* Update sessions on bots and dependencies

* update the script based on the new folder structure

* action: update the target branch name (KTH#1609)

* added README describing our presentation proposal (KTH#1593)

* added README describing our presentation proposal

* updated readme to fit the expected format

* Update week 2 agenda

* Update demo + presentation weeks

* First proposal for course automation (KTH#1579)

* Add proposal for course automation task (KTH#1586)

* Add proposal for course automation task

* Rework proposal

* Slight modification

* Update README.md

Co-authored-by: Khashayar Etemadi <khaes@kth.se>

* Essay proposal: CI comparison (KTH#1598)

* docs: add README for proposal (KTH#1603)

* executable-tutorial: proposal GH Action optimization (KTH#1572)

* executable-tutorial: proposal GH Action optimization

* fix: formatting of README.md

* Update readme.md

* Update readme.md

* Presentation proposal - Facebook blackout (KTH#1592)

* added our presentation proposal

* added presentation

* Rename contributions/presentation/README.md to contributions/presentation/week2-testing-and-CI/svanhol-libl/README.md

Co-authored-by: vladomitrovic <vlado.mitrovic@outlook.com>

* Update readme.md

* Presentation proposal - Code Coverage (KTH#1582)

* Added a presentation proposal for code coverage.

* Correct folder

* Changed readme to comply with necessary formatting.

* Reformulated our proposal to be more specific.

Co-authored-by: vladomitrovic <vlado.mitrovic@outlook.com>

* Update week 2 agenda

* Update readme.md

* Update README.md

* Presentation : robot framework and end user test (KTH#1611)

* Delete README.md

* Update readme.md

* Delete README.md

* Added demo proposal (KTH#1614)

Co-authored-by: Preston Chao <prestonchao@n183-p220.eduroam.kth.se>

* Create README.md (KTH#1612)

* Create Proposal for presentation: deployment of code with Buddy (KTH#1604)

* Create Proposal for presentation: deployment of code with Buddy

* Rename contributions/presentation/week3-CD-and-feature-flag/lhagm-shotaro/Proposal for presentation: deployment of code with Buddy to contributions/presentation/week3-CD-and-feature-flag/lhagm-shotaro: README.md

* Update lhagm-shotaro: README.md

* DEMO Proposal: Eiffel Protocol demonstration of usage (KTH#1610)

* Update README.md

* moved proposal to correct space

* added slides used in the presentation and a link to them (if needed) in the README. (KTH#1621)

* Presentation Proposal Update: Add link to slides (KTH#1613)

* link to slides

* format

* ugh format

Co-authored-by: Luke LeVasseur <llevasseur@flexport.com>

* Final submission: Presentation (gatien-myechui) (KTH#1620)

* unregistere user removed from foldername

* unregistered user removed from the readme

* Update and rename readme.md to README.md

* Update README.md

* Demo proposal : Continuous Delivery of a Tauri app (KTH#1628)

* Added task 1 proposal

* Fixed typo

* Updated folder name

* Added demo proposal

* Fixed email address

* Fixed typos

* Course automation proposal - Automatic labeling of PRs (KTH#1608)

* add proposal for course automation task

* add new proposal

* align demo length with presentation length (KTH#1618)

* course-automation: Automatic verification for mandatory parts of course-automation final (KTH#1629)

* docs: 📝 task: course-automation complete

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Adds proposal for course automation task. (KTH#1606)

Adds proposal for a course automation task that would automatically fetch calendar events for the course to display in a file of choice.

* Add slides week 1 presentation slides (KTH#1640)

* Presentation proposal : Robot framework


Assignment Proposal
Robot framework and user test 


Names and KTH ID

    Pauline Vaillant (paulinev@kth.se)
    Asim Jarrar (asmin@kth.se)

Deadline

Task 1
Category
Presentation


Description
Presentation of robot framework

* Change readme place

* Delete paulinev-asmi

* Create readme

* Correction file name

* Delete typo directory

* Correct typo 2

* Delete paulinev-asim

* Create readme.md

* Remove wrong typo directory

* Update readme.md

* Add presentation slide

* Add presentation slides

* Delete useless directory

* Demo proposal: Demonstration of continuous deployment using Bitbucket Pipes (KTH#1641)

* Create proposal template

* Update readme.md

* Added task proposal

* Fixed kth name

* fix readme

* Finished Executable Tutorial - Build automation with Maven and Selenium to maintain test automation  (KTH#1632)

* Added README.md for Project Proposal

* Added grading information for the executable tutorial

* cleaning

* executed tutorial: Github Action CI pipeline using CodeQL for static code scanning (DevSecOps Application) (KTH#1616)

* Adding Assignment proposal

* Update README.md

Adding links to our GitHub handles

* Update README.md

Edit description

* Update README.md

Removing Github handles as it crashes the script

* Updating folder name

* Add repository links of "Testing frameworks for JavaScript in frontend and backend" demo to respective readme (KTH#1625)

* ADD tutorial proposal for Randoop (KTH#1648)

* added readme for demo proposal (KTH#1642)

* Presentation Proposal: An overview of continuous deployment in the Microsoft Azure environment (KTH#1644)

* Create README.md

* Update README.md

* Update README.md

* Added readme for presentation proposal (KTH#1637)

* presentation: Serverless in a hybrid architecture (KTH#1615)

* Adding initial proposal

* Fixing folder name

* Added readme for tutorial (KTH#1627)

* executable tutorial (KTH#1643)

* demo proposal for argocd (KTH#1649)

* Course Automation: Enforcing course submission rules (KTH#1650)

* civjan-palagi course automation proposal

* Update README.md

Co-authored-by: Khashayar Etemadi <khaes@kth.se>

* demo proposal: CD using React Native and Google Cloud (KTH#1635)

Co-authored-by: Filip Bäck <filipback@n145-p222.eduroam.kth.se>

* Course Automation Proposal: Make Pull Request shell script (KTH#1645)

* add proposal for mpr shell script

* update readme

* update

Co-authored-by: Luke LeVasseur <llevasseur@flexport.com>

* Essay proposal - Continuous deployment - How does feature toggle fit in? (KTH#1630)

* Demo proposal: CD of a Node.js web service on Heroku with a Github Actions pipeline (KTH#1636)

* Create demo proposal readme

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Khashayar Etemadi <khaes@kth.se>

* Presentation proposal: Canary Deployment - Why you and your friends might have different versions of the same app (KTH#1623)

* Added README for presentation for week three

* Blank line for PR update

Now that the asim not registered problem is fixed

* Added presentation in Category

Co-authored-by: tobiasgg <tobiasgg@kth.se>

* Add files via upload (KTH#1653)

* Proposal Executable Tutorial: Test automation using Cucumber with Gradle (KTH#1658)

* WIP: program of week 3 (KTH#1647)

* Update readme.md

* Update readme.md

* Update week 4 presentation/demo schedule (KTH#1672)

Co-authored-by: Khashayar Etemadi <khaes@kth.se>

* Create README.md (KTH#1651)

* Update readme.md (KTH#1676)

* Update readme.md

* Delete README.md

* Update readme.md

* Update required number of words for essays check

* Essay: Gitlab CI vs Github Actions (KTH#1688)

* Presentation Proposal: Handling multiple services in a monorepo using Docker (KTH#1677)

Co-authored-by: Luciano <luciano.zapata@mentimeter.com>

* Update readme.md

* Course Automation: Implementation of MPR shell script (KTH#1654)

* initial script

* MPR functionality working

* Clean up

* Update alias in help

* Clean Up

* Small change for demo

* Small change for demo

* Auto-fill description body with readme contents

* Update description logic

* Update description logic

* Tweaks

* Only use GH Username if user not populated

* Tweak

* Add link to readme for submission

* Remove script from submission

Co-authored-by: Luke LeVasseur <llevasseur@flexport.com>

* Proposal: Contribution to open-source (KTH#1721)

* Add completed demo branch (KTH#1719)

* Create demo proposal readme

* Update README.md

* Update README.md

* Update README.md

* Add demo repo link

* Remove unnecessary section

Co-authored-by: Khashayar Etemadi <khaes@kth.se>

* Tutorial proposal: Massively cutting server costs for model training with spot instances on Azure (KTH#1718)

* Add proposal for course automation task

* Rework proposal

* Slight modification

* Update README.md

* Add essay proposal

* Add Khalid to proposal

* Delete README.md

Co-authored-by: Khashayar Etemadi <khaes@kth.se>
Co-authored-by: César Soto Valero <cesarsotovalero@gmail.com>

* Submission : Demonstration of Continuous Deployment of a Tauri app (KTH#1717)

* Updated readme for submission

* Fixed some typos

* Fixed README

* Final Submission for Task 1 (KTH#1715)

* demo proposal for argocd

* Submission for Task 1

* Update README.md

* update submission git link

* Update README.md

* Update README.md

* Final submission - Github Action CI pipeline using CodeQL for static code scanning (DevSecOps Application) (KTH#1714)

* Adding Assignment proposal

* Update README.md

Adding links to our GitHub handles

* Update README.md

Edit description

* Update README.md

Removing Github handles as it crashes the script

* Updating folder name

* Adding assignment description

* Final Submission: Docker swarm executable tutorial (KTH#1709)

* docs: add README for proposal

* Final submission: exec tutorial

* Final Submission for Task 1 - CI/CD pipeline for K8s Cluster in Digital Ocean for Microservices application. (KTH#1701)

* added readme for demo proposal

* Submission for Task 1

Co-authored-by: César Soto Valero <cesarsotovalero@gmail.com>

* Final Submission: Fuzzing Executable Tutorial (KTH#1705)

* Proposal for OSS-Fuzz executable tutorial

* final submission README

* working on final submission

* marked easter-egg

Co-authored-by: Palagi, Brad <bpalagi2@illinois.edu>

* Finished E2E testing with React executable tutorial (KTH#1699)

* Final Submission: Deployment of Ccde Using Buddy (KTH#1697)

* Adds Assignment Proposal (KTH#1689)

Co-authored-by: Pontus Cowling Mantefors <pontuscm@kth.se>

* Added demo repo & key takeaway (KTH#1702)

* Create proposal template

* Update readme.md

* Added task proposal

* Fixed kth name

* fix readme

* Add bitbucket repo link

* Submission: Essay: DevOps and Security - How to fit them together? (KTH#1706)

* Create README.md

* Create DevSecOps.pdf

* Updated to pass word count

* Less word count

* Update DevOps_and_Security - How_to_fit_them_together.pdf

* Created final submission for civjan-palagi course automation (KTH#1704)

* Mockito Presentation (KTH#1595)

* Update README.md

* Update README.md

* Rename contributions/presentation/README.md to contributions/presentation/week2-testing-and-CI/ddnadjar/README.md

* Update README.md

Co-authored-by: Khashayar Etemadi <khaes@kth.se>
Co-authored-by: vladomitrovic <vlado.mitrovic@outlook.com>

* Final Submission: Executable Tutorial (KTH#1692)

* executable-tutorial: proposal GH Action optimization

* fix: formatting of README.md

* [ Final Submission ] executable tutorial

* fix: assignment and README seperation

* fix: added links

* fix: put links in proposal README

* fix: removed header to pass action

Co-authored-by: lucianozapata <60700288+lucianozapata@users.noreply.github.com>
Co-authored-by: isabelredtzer <60987948+isabelredtzer@users.noreply.github.com>
Co-authored-by: joloev <49996573+joloev@users.noreply.github.com>
Co-authored-by: Johanna Loev <jolov@kth.se>
Co-authored-by: Luke LeVasseur <lukelev@uw.edu>
Co-authored-by: Luke LeVasseur <llevasseur@flexport.com>
Co-authored-by: EDChui <edchuihk@gmail.com>
Co-authored-by: Diego Chahuan <61998030+dchahuan@users.noreply.github.com>
Co-authored-by: Fabian Segatz <53816763+fsegatz@users.noreply.github.com>
Co-authored-by: vladomitrovic <vladom@kth.se>
Co-authored-by: Aïssata Maiga <40670675+Dajamante@users.noreply.github.com>
Co-authored-by: lnsandnkth <98472625+lnsandnkth@users.noreply.github.com>
Co-authored-by: elibon99 <45691787+elibon99@users.noreply.github.com>
Co-authored-by: Benoit Baudry <baudry@kth.se>
Co-authored-by: gluckzhang <zhanglong3030@qq.com>
Co-authored-by: Per Arn <pelle.arn@gmail.com>
Co-authored-by: Deepika Tiwari <deepikatiwari92@gmail.com>
Co-authored-by: Philip Hamelink <75215820+phamelink@users.noreply.github.com>
Co-authored-by: Neproxx <marcel-ju@web.de>
Co-authored-by: Khashayar Etemadi <khaes@kth.se>
Co-authored-by: Niko <48829358+nikolim@users.noreply.github.com>
Co-authored-by: Joakim Olsson <jooled13@outlook.com>
Co-authored-by: Arvid Gotthard <66034456+mellonnen@users.noreply.github.com>
Co-authored-by: Fredrik Svanholm <54528582+JustFredrik@users.noreply.github.com>
Co-authored-by: vladomitrovic <vlado.mitrovic@outlook.com>
Co-authored-by: Max Persson <40460583+PersonligaPersson@users.noreply.github.com>
Co-authored-by: paulinev-kth <102533085+paulinev-kth@users.noreply.github.com>
Co-authored-by: Martin Monperrus <martin.monperrus@gnieh.org>
Co-authored-by: pdchao23 <61924616+pdchao23@users.noreply.github.com>
Co-authored-by: Preston Chao <prestonchao@n183-p220.eduroam.kth.se>
Co-authored-by: Zehao Jiang <zehao323@gmail.com>
Co-authored-by: Linnea55 <63721996+Linnea55@users.noreply.github.com>
Co-authored-by: LukasGutenberg <Luckeg@hotmail.com>
Co-authored-by: corentinguilloteau <60315917+corentinguilloteau@users.noreply.github.com>
Co-authored-by: Daniel Gustafsson <51636611+halvtomat@users.noreply.github.com>
Co-authored-by: John Landeholt <46650602+landeholt@users.noreply.github.com>
Co-authored-by: Johan Edman <22528843+EdmanJohan@users.noreply.github.com>
Co-authored-by: Abyel Tesfay <43177672+AbyelT@users.noreply.github.com>
Co-authored-by: Bassam Gamal <Bassam.gamal@gmail.com>
Co-authored-by: nalenz <julian.nalenz@web.de>
Co-authored-by: Mustafa Ali <62649206+mustafamusse@users.noreply.github.com>
Co-authored-by: Abdullah <50807325+Abdullah1428@users.noreply.github.com>
Co-authored-by: Noah Rahimzadagan <77496609+noahra@users.noreply.github.com>
Co-authored-by: sandy-e <55145273+sandy-e@users.noreply.github.com>
Co-authored-by: FilipSannervik <45691805+ZerooCoool@users.noreply.github.com>
Co-authored-by: Ayushman Khazanchi <aykhazanchi@users.noreply.github.com>
Co-authored-by: Ben Civjan <50936171+bencivjan@users.noreply.github.com>
Co-authored-by: Filip Bäck <45845878+bckfilip@users.noreply.github.com>
Co-authored-by: Filip Bäck <filipback@n145-p222.eduroam.kth.se>
Co-authored-by: persman96 <64256070+persman96@users.noreply.github.com>
Co-authored-by: Nick Smyrnioudis <32795986+NickSmyr@users.noreply.github.com>
Co-authored-by: Samuel Söderberg <42773959+kaggenius@users.noreply.github.com>
Co-authored-by: tobiasgg <tobiasgg@kth.se>
Co-authored-by: gogo432754 <51891396+gogo432754@users.noreply.github.com>
Co-authored-by: shotaroi <58347058+shotaroi@users.noreply.github.com>
Co-authored-by: Javier Ron Arteaga <javierron90@gmail.com>
Co-authored-by: simonebonato <63954877+simonebonato@users.noreply.github.com>
Co-authored-by: Bror Sebastian Sjövald <49447840+BrorSebastianSjovald@users.noreply.github.com>
Co-authored-by: Luciano <luciano.zapata@mentimeter.com>
Co-authored-by: César Soto Valero <cesarsotovalero@gmail.com>
Co-authored-by: Brad Palagi <61440600+bpalagi@users.noreply.github.com>
Co-authored-by: Palagi, Brad <bpalagi2@illinois.edu>
Co-authored-by: Pontus Mantefors <58608924+pontuscm@users.noreply.github.com>
Co-authored-by: Pontus Cowling Mantefors <pontuscm@kth.se>
Co-authored-by: mindany2 <robindesbois1000@hotmail.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
course_automation final_submission The final submission of a task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants