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

ci: Better error message on missing builder key #544

Merged
merged 1 commit into from
Dec 19, 2022
Merged

ci: Better error message on missing builder key #544

merged 1 commit into from
Dec 19, 2022

Conversation

maflcko
Copy link

@maflcko maflcko commented Dec 19, 2022

Print the command that people can copy-paste to add their builder key, if it was declared missing by CI

Also, add ascii check for all files.
@fanquake fanquake merged commit 9681bb0 into bitcoin-core:main Dec 19, 2022
@maflcko maflcko deleted the asc branch December 21, 2022 08:59
@@ -7,7 +7,14 @@ fn check_attestations(atts: Vec<&str>, mut keys: HashSet<&str>) -> Result<(), St
let builder_key = format!("builder-keys/{builder}.gpg");
keys.remove(&builder_key as &str);
let builder_key_file = std::fs::File::open(&builder_key)
.map_err(|e| format!("Builder key not found for attestation. Attestation: '{att}', Key: '{builder_key}', Error: '{e}'"))?;
.map_err(|e| format!("Builder key not found for attestation. Attestation: '{att}', Key: '{builder_key}', Error: '{e}'.\nHelp: Run 'gpg --export --armor {builder} > {builder_key} && git add {builder_key}'"))?;
Copy link
Author

Choose a reason for hiding this comment

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

Looks like the \n remains escaped in the CI log. Maybe a good first issue if someone wants to fix this in a follow-up?

for file in [&builder_key, att, &format!("{att}.asc")] {
let content = std::fs::read_to_string(file).unwrap();
if !content.chars().all(|c| c.is_ascii()) {
return Err(format!("All files must be in ascii format. Make sure to pass --armor to gpg. File: {file}"));
Copy link
Author

Choose a reason for hiding this comment

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

@bitcoin-core bitcoin-core locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants