Skip to content

fix(fetch): Include revision in hashing for pypi #41

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

Open
wants to merge 1 commit into
base: production
Choose a base branch
from

Conversation

xtexx
Copy link
Member

@xtexx xtexx commented May 10, 2025

Hashing only the URL part will lead to dirty caches.

@xtexx xtexx requested a review from liushuyu May 10, 2025 03:42
Copy link

what-the-diff bot commented May 10, 2025

PR Summary

  • Removed the hash_url function
    An old function used called hash_url has been removed to allow for better practices.

  • Introduced a new function for generating hashes
    A new function named hash_source_uri has been introduced. It is designed to generate a unique identification code (hash) based on several elements including the URL's type, the specific URL, any revisions, and the branch it's associated with. This new method is more reliable.

  • Updated the fetch_source function
    The fetch_source function that is used to retrieve data now uses the new hash_source_uri function. These adjustments contribute to more efficient data retrieval.

  • Adjusted file path utilization
    The way file paths are used in tarball_fetch function, which is used for data extraction, has been slightly altered. Now, it utilises source name instead of the hashed filename. This change simplifies data tracking.

  • Added test for new function
    Testing for the new function, hash_source_uri, has been included to confirm it generates unique identification codes for different inputs. This adds assurance on the reliability of the function.

@xtexx xtexx force-pushed the hash-rev branch 2 times, most recently from 99f5cd7 to c04fe0e Compare May 10, 2025 05:44
@xtexx xtexx changed the title fix(crypto): take source URI type and revision into hashing fix(fetch): Include revision in hashing for pypi May 10, 2025
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

Successfully merging this pull request may close these issues.

2 participants