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

Too easy to commit directly to registry master/main branch #86

Open
IanButterworth opened this issue Apr 29, 2024 · 6 comments
Open

Too easy to commit directly to registry master/main branch #86

IanButterworth opened this issue Apr 29, 2024 · 6 comments

Comments

@IanButterworth
Copy link
Contributor

Running just

register("Foo")

will currently register, commit, and push to the remote.

At least in interactive mode, I would like to review before pushing to remote, especially in my case where I was still on master, and wanted to create a PR for the new version.

Avoiding a breaking change, if isinteractive perhaps there could be prompts to ask?

@GunnarFarneback
Copy link
Owner

It's easy by design.

Something I would consider is a mechanism to customize kwarg defaults and store them in a scratch space.

@IanButterworth
Copy link
Contributor Author

Would you be open to if:

  1. On master/main
  2. In interactive mode

prompt to confirm push to remote?

@Octogonapus
Copy link

I haven't hit this footgun yet but I can see it happening, Ian's most recent suggestion sounds like a good compromise to me.

@GunnarFarneback
Copy link
Owner

No. With a personal registry it's perfectly reasonable to push straight to the default branch without PRs and do it in interactive mode.

I would accept a PR adding a :prompt alternative to the push kwarg though (which could fall back to true in non-interactive mode).

@IanButterworth
Copy link
Contributor Author

How common is a personal registry? I hadn't considered that people have such things. In my experience registries have been shared between people.

I use this package mostly automatically, but sometimes manually to do things with a company registry, HolyLabRegistry and General, all of which I have commit bit for. The automatic push nature of register just seems unusually risky. (Even though General probably has push to master disabled, probably)

Are you suggesting that the :prompt kwarg would be an option but not the new default?

@GunnarFarneback
Copy link
Owner

How common is a personal registry?

I have no usage stats but it's with some regularity proposed on discourse as a solution to handling personal interdependent packages.

probably has push to master disabled

All git hosting systems have the option to disallow pushing to selected branches and, frankly, if a direct push to the default branch might cause any kind of inconvenience, it's a major mis-configuration to allow it.

Are you suggesting that the :prompt kwarg would be an option but not the new default?

Yes, but it could be combined with the idea in my first reply.

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

No branches or pull requests

3 participants