Implement T9L1/create-pr-from-main#276
Conversation
|
Hi @desmondwong1215, thank you for your contribution! 🎉 This PR comes from your fork Before you request for a review, please ensure that you have tested your changes locally! Important The previously recommended way of using Please read the following instructions for the latest instructions. PrerequisitesEnsure that you have the Testing stepsIf you already have a local Git-Mastery root to test, you can skip the following step. Create a Git-Mastery root locally: gitmastery setupNavigate into the Git-Mastery root (defaults to cd gitmastery-exercises/Edit the {
# other fields...
"exercises_source": {
"username": "desmondwong1215",
"repository": "exercises",
"branch": "exercise/create-pr-from-main"
}
}Then, you can use the gitmastery download <your new change>
gitmastery verifyChecklist
Important To any reviewers of this pull request, please use the same instructions above to test the changes. |
4fdf214 to
054153b
Compare
64464d1 to
3f342a4
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new Git-Mastery exercise (create-pr-from-main) intended to grade students on creating a PR from their fork’s main branch to the upstream repo and then pushing a follow-up commit that fixes Java.txt.
Changes:
- Introduces a new exercise verifier (
verify.py) that fetches the student’s PR and validates branch + file contents. - Adds unit tests (
test_verify.py) to cover success and failure paths. - Adds exercise scaffolding: download hook, README link, and
.gitmastery-exercise.jsonconfig for a remote repo-backed exercise.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| create_pr_from_main/verify.py | Implements PR discovery/fetch and Java.txt content validation. |
| create_pr_from_main/test_verify.py | Adds unit tests for the new verifier logic. |
| create_pr_from_main/download.py | Sets start tag and configures PR repo full name for the exercise. |
| create_pr_from_main/README.md | Links to the hosted exercise instructions. |
| create_pr_from_main/.gitmastery-exercise.json | Declares exercise metadata and remote repo configuration. |
| create_pr_from_main/init.py | Package marker for the exercise module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@desmondwong1215 I presume this won't work until we update the app to the latest version? For now, I'll try to test by compiling the latest binary and using that instead of the official release one. |
|
@desmondwong1215 Encountering this error at the end of step 2, do you know what's the issue? I'm currently using the latest build of the app with the correct repo-smith and git-autograder versions.
|
|
It seems like the exercise_config is not updated correctly in the first run in the REPL. It does not have an error when I run it the second time in the REPL or run |
|
@desmondwong1215 Thanks the fix worked! However, I'm still getting some errors in verification after updating to
Do you know the issue? Is this a cache issue by |
| WRONG_HEAD_BRANCH = "The PR's head branch is not 'main'." | ||
|
|
||
|
|
||
| EXPECTED_CONTENT_STEP_3 = ["1955, by James Gosling"] |
There was a problem hiding this comment.
Thanks for catching this. I have fixed it already.
805225d to
980bf18
Compare
jovnc
left a comment
There was a problem hiding this comment.
LGTM, feel free to merge if ready




Exercise Review
Exercise Discussion
Fixes #274
Checklist
Git-Masteryorganization, have you created a request for it?repo-smithto validate the exercise grading scheme?git-autograder?app?