-
Notifications
You must be signed in to change notification settings - Fork 25
Implement exercise T4L2/tags-add #85
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
base: main
Are you sure you want to change the base?
Conversation
|
@MousseDm Closing this as you already have one hp-* PR |
Ah, right. Thanks @VikramGoyal23 |
woojiahao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left several comments. The main points are:
- Create unit tests for the autograding to ensure that it works. If there are commands that are insufficient from repo-smith, ping me and I will add them
- All comments should be a constant for ease of unit testing
- All comments should avoid using the ` character. Use " instead
| __resources__ = [] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| __resources__ = [] |
| 1. Add a **lightweight** tag `first-pilot` to the **first commit**. | ||
| 2. Add an **annotated** tag `v1.0` to the commit that updates March duty roster, with message `first full duty roster`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should go under Task
| ```bash | ||
| # first commit | ||
| git rev-list --max-parents=0 HEAD | ||
|
|
||
| # add lightweight tag | ||
| git tag first-pilot <FIRST_COMMIT_SHA> | ||
|
|
||
| # find the commit for "Update roster for March" | ||
| git log --oneline | grep -i "Update roster for March" | ||
|
|
||
| # add annotated tag with message | ||
| git tag -a v1.0 -m "first full duty roster" <MARCH_COMMIT_SHA> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Github collapsible sections.
| ```bash | ||
| # first commit | ||
| git rev-list --max-parents=0 HEAD | ||
|
|
||
| # add lightweight tag | ||
| git tag first-pilot <FIRST_COMMIT_SHA> | ||
|
|
||
| # find the commit for "Update roster for March" | ||
| git log --oneline | grep -i "Update roster for March" | ||
|
|
||
| # add annotated tag with message | ||
| git tag -a v1.0 -m "first full duty roster" <MARCH_COMMIT_SHA> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a missing closing tag for the code block. Add ``` to the end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need unit tests to ensure that the autograding works. Please refer to the other exercises to understand how autograding unit testing works.
| comments.append(f"Missing annotated tag `{SECOND_TAG}`.") | ||
| else: | ||
| if not isinstance(getattr(t_v1, "tag", None), TagObject): | ||
| comments.append(f"`{SECOND_TAG}` must be an annotated tag.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant
| else: | ||
| msg = (t_v1.tag.message or "").strip() | ||
| if msg != SECOND_TAG_MSG: | ||
| comments.append(f"`{SECOND_TAG}` message must be exactly `{SECOND_TAG_MSG}`.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant
| if msg != SECOND_TAG_MSG: | ||
| comments.append(f"`{SECOND_TAG}` message must be exactly `{SECOND_TAG_MSG}`.") | ||
| if not march_commit: | ||
| comments.append(f"Could not find the commit containing '{MARCH_MSG_FRAGMENT}'.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant
| comments.append( | ||
| f"`{SECOND_TAG}` should point to March commit {march_commit.hexsha[:7]}, " | ||
| f"but points to {t_v1.commit.hexsha[:7]} instead." | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant
| status = GitAutograderStatus.SUCCESSFUL if not comments else GitAutograderStatus.FAILED | ||
| return exercise.to_output(comments, status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would like to provide positive feedback if they do succeed! So I would opt to provide a positive note for students like "Great work using git tag to annotate various commits in the repository!"
Exercise Review
Exercise Discussion
#61
Checklist
Git-Masteryorganization, have you created a request for it?repo-smithto validate the exercise grading scheme?test-download.sh?git-autograder?app?