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

remote add sets new endpoint as default, suppressible via flag #1920

Conversation

preminger
Copy link
Contributor

@preminger preminger commented Jul 20, 2023

Description of the Pull Request (PR):

When adding a remote via singularity remote add <remote_name> <remote_uri>, the newly-added remote will be selected as the current remote endpoint by default.

This can be suppressed (and thus, returned to the previous behavior of remote add) by supplying the -n/--no-default flag to remote add.

This fixes or addresses the following GitHub issues:

@preminger preminger marked this pull request as ready for review July 20, 2023 20:27
@preminger preminger requested a review from dtrudg July 20, 2023 20:27
@preminger preminger force-pushed the 1895-automatically-select-argument-to-remote-add-as-current-remote branch 2 times, most recently from 96740be to 21d5eab Compare July 21, 2023 03:42
Copy link
Member

@dtrudg dtrudg left a comment

Choose a reason for hiding this comment

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

Needs e2e testing in e2e/remote/remote.go

The unit tests against remoteAdd() are using a positive 'makeDefault'.

Since the CLI behaviour is the opposite, a negative 'not- default', an e2e test is warranted.

The e2e remote tests are poorly structured, and it might be a bit of a pain to add these checks, but we should take this opportunity to improve the coverage of the CLI.

cmd/internal/cli/remote.go Outdated Show resolved Hide resolved
@preminger
Copy link
Contributor Author

The unit tests against remoteAdd() are using a positive 'makeDefault'.

Wait, are we looking at the same thing here? I doubled the set of tests in TestRemoteAdd() in internal/app/singularity/remote_add_test.go - instead of 30, there are now 60 - and the two blocks differ in precisely the value of tt.makeDefault they have.

(I think it's possible that GitHub didn't show this because of its "large commits are hidden by default" thing.)

Plus, TestRemoteRemove() in internal/app/singularity/remote_remove_test.go also tests both settings of makeDefault now.

@preminger preminger force-pushed the 1895-automatically-select-argument-to-remote-add-as-current-remote branch from 6934ce7 to 3678223 Compare July 21, 2023 16:19
@preminger preminger requested a review from dtrudg July 21, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatically select argument to remote add as current remote
2 participants