-
Notifications
You must be signed in to change notification settings - Fork 115
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
Allow to set the time waited between two cargo publishs #257
Conversation
Sorry no one has responded on this. This could actually help in #218. There is a part of me that would prefer for this to be an env variable, like |
I would be totally fine with an env variable as well. Has btw anyone made an issue at https://github.com/rust-lang/crates.io/issues about some API feature to poll if a crate is ready? |
My understanding is that git is the API; we've just not been able to determine what we are doing differently than |
I made an issue at crates.io now anyways. I think it would be useful to have a simple way to automate crate publishing without complicated hacks. |
@epage Do you have any suggestion about the criteria to classify the location of configuration, among cli options, toml files or environment variables? I think I have a little sense with the difference between cli options and toml files. But for environment variable, I can't tell it from cli options. |
@sebschmi you might want to format the code to pass our rustfmt check. |
Im honestly going off of gut feel here and can be completely wrong :) I think
So far, I only use env variables to comply with the various CLI colored output standards. In this case, the wait time doesn't really fit into any of the categories. This is a workaround for another bug and there isn't anything about this that is repo -specific. For user-relevant, it sort of is just by how much the user can tolerate failure vs delays. For integration-relevant, it sort of is to help us with #218 where there is another bug/limitation in our wait logic. So based on my earlier classifications. this most closely aligns with how I've been using CLI args / user-config. The reason I'm considering other approaches, like modeling after some crate processes, like |
@sunng87 I will keep out of the discussion of this being a CLI argument or env variable. But as soon as you come to an agreement, I will make the necessary changes, also to make it pass the CI checks. |
Hopefully this is enough for crates.io to update their index...
I changed the code, and kept the impact of the env variable minimal: I simply directly query it at the I did not document this feature, if you want to I can do it. |
@sebschmi sorry for late response. I will update document for you. |
No worries, thank you very much for merging! |
This adds a command line parameter
--publish-grace-sleep
that defines how long we wait between two invocations ofcargo publish
. The default value is 5.