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

Add base_publisher_url to file/release events. #15872

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

di
Copy link
Member

@di di commented Apr 26, 2024

This fixes an issue with #15862, where the publisher_url for most events contained a commit SHA, and therefore had additional parts that made it hard to compare with project URLs.

The workaround is to introduce a base_publisher_url additional field that represents the unique "root" of the publisher for all publishers (i.e. the github repo) which we can use to compare to project URLs to verify them.

This means that these links will become verified only once a new event is published with this additional field, which should slowly happen over time.

To speed this up, we could do a one-off data migration to add base_publisher_url to existing events, but I think this should be fine as-is.

@di di requested a review from a team as a code owner April 26, 2024 17:36
)
DBFileEventFactory.create(
source=release_file,
tag="fake:event",
additional={"publisher_url": publisher_url},
additional={"base_publisher_url": base_publisher_url},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this second event?

Copy link
Member Author

Choose a reason for hiding this comment

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

To catch the bug that this commit fixed: 7f93c42. It was failing because it doesn't work when there are multiple events found.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see!! Awesome! Thanks!

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.

None yet

2 participants