Skip to content

Conversation

@VikramGoyal23
Copy link
Contributor

Exercise Review

Exercise Discussion

#63

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?

@VikramGoyal23
Copy link
Contributor Author

The tests are implemented entirely through mocking due to the unique nature of the exercise.

@VikramGoyal23
Copy link
Contributor Author

Fixes #63

@damithc damithc linked an issue Nov 2, 2025 that may be closed by this pull request
1 task
@woojiahao woojiahao added the exercise review Review a proposed exercise label Nov 10, 2025
@woojiahao woojiahao self-assigned this Nov 20, 2025
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.

Left some comments, but overall, the exercise structure makes sense!

Copy link
Member

Choose a reason for hiding this comment

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

Could you add the instructions for students to this README?

TAG_2_MESSAGE = "First stable roster"

def setup(verbose: bool = False):
create_start_tag(verbose)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this start tag!

create_start_tag(verbose)
run_command(["git", "remote", "rename", "origin", REMOTE_NAME], verbose)
tag(TAG_DELETE_NAME, verbose)
push(REMOTE_NAME, "--tags", verbose) # somewhat hacky, maybe use run_command instead
Copy link
Member

Choose a reason for hiding this comment

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

Yeap this is a hack, please use run directly! I would avoid undocumented hacks to save future confusion

Comment on lines 7 to 11
REMOTE_NAME = "production"
TAG_1_NAME = "v1.0"
TAG_2_NAME = "v2.0"
TAG_DELETE_NAME = "beta"
TAG_2_MESSAGE = "First stable roster"
Copy link
Member

Choose a reason for hiding this comment

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

I would be wary of including so many constants that are only used once. It's easier if you inline these values directly

from exercise_utils.git import tag, push
from exercise_utils.gitmastery import create_start_tag

__resources__ = {}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
__resources__ = {}

Since we don't need any resources, remove this line!

Comment on lines +45 to +47
username = get_username()
if username is None:
raise exercise.wrong_answer([IMPROPER_GH_CLI_SETUP])
Copy link
Member

Choose a reason for hiding this comment

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

In all fairness, this should not be necessary because the requires_github check already covers it, but I get the current constraint. Happy to keep this for now.

Comment on lines 101 to 103
pytest.raises(GitAutograderWrongAnswerException) as exception,
):
verify(exercise)
Copy link
Member

Choose a reason for hiding this comment

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

I believe that you can use pytest.raises(Exception, match='') to match the body of the exception! So you shouldn't need to run a separate assert

Comment on lines +111 to +113
pytest.raises(GitAutograderWrongAnswerException) as exception,
):
verify(exercise)
Copy link
Member

Choose a reason for hiding this comment

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

See previous comment

Comment on lines 81 to 85
pytest.raises(GitAutograderWrongAnswerException) as exception,
):
verify(exercise)

assert exception.value.message == [IMPROPER_GH_CLI_SETUP]
Copy link
Member

Choose a reason for hiding this comment

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

See previous comment

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to include the case where all checks fail so we're verifying against multiple comments.

@VikramGoyal23
Copy link
Contributor Author

Thanks for the feedback. I should hopefully resolve these issues within the next 1-2 days.

- Added instructions to README
- Removed hacks and cleaned up download.py
- Removed GH API call
- Cleaned up test_verify.py
- Added new test
@VikramGoyal23
Copy link
Contributor Author

@woojiahao Could you review my changes?

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.

Minor nit for formatting. The change I've suggested might affect the unit tests, so it will be good to verify that.

Could you re-run the ./test-download.sh tags-push script to ensure that all the tags have the right message?

run_command(["git", "tag", TAG_1_NAME, "HEAD~4"], verbose)
run_command(["git", "tag", "-a", TAG_2_NAME, "HEAD~1", "-m", f"\"{TAG_2_MESSAGE}\""], verbose)
run_command(["git", "tag", "v1.0", "HEAD~4"], verbose)
run_command(["git", "tag", "-a", "v2.0", "HEAD~1", "-m", f"\"{"First stable roster"}\""], verbose)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run_command(["git", "tag", "-a", "v2.0", "HEAD~1", "-m", f"\"{"First stable roster"}\""], verbose)
run_command(["git", "tag", "-a", "v2.0", "HEAD~1", "-m", "First stable roster"], verbose)

The quotes in the code from the exercise review were for the -m parameter, it's not necessary when passed this way!

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-push

2 participants