Skip to content

Conversation

@jovnc
Copy link
Contributor

@jovnc jovnc commented Oct 28, 2025

Exercise Review

Exercise Discussion

Fixes #62

Checklist

  • If you require a new remote repository on the Git-Mastery organization, have you created a request for it?
  • Have you written unit tests using repo-smith to validate the exercise grading scheme?
  • Have you tested the download script using test-download.sh?
  • Have you verified that this exercise does not already exist or is not currently in review?
  • Did you introduce a new grading mechanism that should belong to git-autograder?
  • Did you introduce a new dependency that should belong to app?

@jovnc
Copy link
Contributor Author

jovnc commented Oct 28, 2025

Opened PR early while waiting to be assigned. Feel free to close if there are duplicates in the future, or if someone else is assigned to this exercise in the future.

This would serve as potential reference to others looking for implementations of exercises as well.

Copy link
Member

@woojiahao woojiahao left a comment

Choose a reason for hiding this comment

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

Thank you @jovnc for working on this exercise! I think that there are some major comments on the ordering of grading, less on the coding style, more so on the autograding philosophy. I will need to update the public documentation to capture this logic too

Comment on lines +29 to +31
def test_wrong_april_tag():
with loader.load("specs/wrong_april_tag.yml", "start") as output:
assert_output(output, GitAutograderStatus.UNSUCCESSFUL, [WRONG_APRIL_TAG_COMMIT])
Copy link
Member

Choose a reason for hiding this comment

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

I think we would also want to ensure that the same check for the January tag commit should exist too, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, would make the tests more comprehensive!

@woojiahao woojiahao added exercise review Review a proposed exercise discussing labels Nov 10, 2025
def tag(tag_name: str, verbose: bool) -> None:
"""Tags the latest commit with the given tag_name."""
run_command(["git", "tag", tag_name], verbose)
def tag(tag_name: str, verbose: bool, commit_ref: str | None = None) -> None:
Copy link
Contributor Author

@jovnc jovnc Nov 10, 2025

Choose a reason for hiding this comment

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

Given that this is repeated multiple times, could we get it as a utility function for future use?

There is an existing tag function under exercise_utils.git, however, it doesn't support tagging a specific commit hash.

We have 2 options:

  1. extend current utility of the tag function to take in optional commit_ref
  2. create a command with a more verbose name tag_with_commit that serves the same purpose as tag but takes in compulsory commit_ref

I have chosen the first option, as it keeps backward compatibility, while ensuring simplicity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to open a new PR to add this change for the util, or can I include it in this PR? Is there anywhere I need to document this change?

@jovnc
Copy link
Contributor Author

jovnc commented Nov 10, 2025

@woojiahao Thanks for the PR review, and the very detailed comments. I have made the changes based on your comments, namely here are the main changes:

  1. modified tag util function to also take in optional parameter commit_ref
  2. add new test for wrong january-tag
  3. reorder verification process to follow order of the task

@jovnc jovnc requested a review from woojiahao November 10, 2025 12:50
@VikramGoyal23
Copy link
Contributor

LGTM, let's wait for @woojiahao's input on the change to the tag function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussing exercise review Review a proposed exercise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Exercise Discussion] T4L2/tags-update

3 participants