Repository navigation
refactor(node)!: remove inert public_read flag #651
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ec04183
refactor(node): remove inert public_read flag
beardthelion 621e9f7
fix(node): warn when the removed public-read env var is set
beardthelion 29b79f6
fix(cli): align doctor with the removed public-read setting
beardthelion d82f9a1
Merge origin/main into flags/remove-public-read
beardthelion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| use std::process::Command; | ||
|
|
||
| #[test] | ||
| fn warns_once_for_either_removed_public_read_env_var() { | ||
| let warning = "TWIGPINE_PUBLIC_READ and GITLAWB_PUBLIC_READ were removed and have no effect. Reads follow each repository's visibility."; | ||
| for (current, legacy) in [ | ||
| (None, None), | ||
| (Some(""), None), | ||
| (None, Some("false")), | ||
| (Some("true"), Some("false")), | ||
| ] { | ||
| let mut cmd = Command::new(env!("CARGO_BIN_EXE_twigpine-node")); | ||
| cmd.env_clear().env("RUST_LOG", "info").args([ | ||
| "--upstream-mirror-enabled", | ||
| "--enforce-owner-push", | ||
| "false", | ||
| ]); | ||
| if let Some(value) = current { | ||
| cmd.env("TWIGPINE_PUBLIC_READ", value); | ||
| } | ||
| if let Some(value) = legacy { | ||
| cmd.env("GITLAWB_PUBLIC_READ", value); | ||
| } | ||
| let output = cmd.output().unwrap(); | ||
| let stdout = String::from_utf8_lossy(&output.stdout); | ||
| let stderr = String::from_utf8_lossy(&output.stderr); | ||
| assert!(!output.status.success()); | ||
| assert!(stderr.contains("invalid configuration: TWIGPINE_UPSTREAM_MIRROR_ENABLED requires")); | ||
| assert_eq!( | ||
| stdout.matches(warning).count(), | ||
| usize::from(current.is_some() || legacy.is_some()), | ||
| "{stdout}" | ||
| ); | ||
| assert!(!stdout.contains("these settings were given under their old GITLAWB_ names")); | ||
| assert!( | ||
| !stdout.contains("these settings have a different value under their old GITLAWB_ name") | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.