Skip to content

Add installer hashes to info.json - #1327

Merged
marcoesters merged 20 commits into
conda:mainfrom
Jrice1317:hashes
Aug 19, 2026
Merged

Add installer hashes to info.json#1327
marcoesters merged 20 commits into
conda:mainfrom
Jrice1317:hashes

Conversation

@Jrice1317

@Jrice1317 Jrice1317 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds installer hashes to info.json so downstream tooling can use it as a single source of truth for installer checksums.

Changes:

  • Calculate requested installer hashes once and reuse them across build outputs.
  • Always include SHA256 in info.json; include additional algorithms requested by hash.
  • Refactor hash_files() to calculate multiple algorithms in one pass.
  • Preserve existing checksum file output.
  • Update schema, docs, and tests

Test expectations:

  • If only info.json is requested → expect SHA256 in _installer_hashes.
  • If only MD5 is requested → expect MD5 and the .md5 checksum file.
  • If both info.json and MD5 requested → expect SHA256 and MD5 to be calculated once and reused.
  • If neither is requested → expect no installer hashes to be calculated.
  • If multiple algorithms are requested → expect all hashes to be calculated in one pass.
  • If info.json and checksum files are generated → expect their hash values to match.
  • Existing SH installer MD5 behavior remains unchanged.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Aug 12, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 12, 2026
@Jrice1317
Jrice1317 marked this pull request as ready for review August 13, 2026 02:23
@Jrice1317
Jrice1317 requested a review from a team as a code owner August 13, 2026 02:23
Comment thread constructor/data/construct.schema.json Outdated
Comment thread constructor/build_outputs.py Outdated
Comment thread constructor/utils.py Outdated
Comment thread constructor/utils.py
Comment thread news/1327-installer-hashes-to-info-json Outdated
Comment on lines +61 to +64
if isinstance(algorithm, str):
algorithms.add(algorithm)
elif algorithm:
algorithms.update(algorithm)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to validate that the hash algorithms are valid. It looks like that part of the code got removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It didn't get removed completely. It got moved here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, yes, thanks for pointing that out! It looks like the test catching that ValueError got removed though, so we are missing some test coverage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ValueError is in utils.py now.

Comment thread constructor/build_outputs.py Outdated
outpath = Path(f"{installer}.{algo}")

with open(outpath, "w", newline="\n") as f:
f.write(f"{info['_installer_hashes'][algo]} {installer.name}\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should have a guard to make sure we don't have an uncaught exception here. That way, we can have a more meaningful error message.

@Jrice1317 Jrice1317 closed this Aug 17, 2026
@github-project-automation github-project-automation Bot moved this from 🆕 New to 🏁 Done in 🔎 Review Aug 17, 2026
@Jrice1317 Jrice1317 reopened this Aug 17, 2026
@github-project-automation github-project-automation Bot moved this from 🏁 Done to 🏗️ In Progress in 🔎 Review Aug 17, 2026
@github-project-automation github-project-automation Bot moved this from 🏗️ In Progress to ✅ Approved in 🔎 Review Aug 19, 2026
@marcoesters
marcoesters merged commit 748baee into conda:main Aug 19, 2026
44 checks passed
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Aug 19, 2026
@Jrice1317
Jrice1317 deleted the hashes branch August 19, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🏁 Done

Development

Successfully merging this pull request may close these issues.

4 participants