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

src/send_kcidb.py: Extract patchset hash from patchwork metadata #299

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

Conversation

yurinnick
Copy link
Contributor

@yurinnick yurinnick commented Aug 1, 2023

Extract head patch hash from patchwork data if it's available. This will allow us to store and populate patch-specific test results and link them to Patchwork.

Fixes kernelci/kernelci-api#307

@spbnick
Copy link

spbnick commented Aug 2, 2023

The KCIDB patchset hash is described here: https://github.com/kernelci/kcidb-io/blob/4691cd7e477083268e69e401fa6d0b6e07f76648/kcidb_io/schema/v04_02.py#L237-L256

However, there's a complication WRT Patchwork. IIRC, it modifies the mbox'es normally used as the patches to add its own tracking information, so just hashing them produces a different hash after every update. The CKI project solution was to strip everything but patches themselves from them to keep it stable.

Copy link
Contributor

@gctucker gctucker left a comment

Choose a reason for hiding this comment

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

This one will depend on the rest of the changes to have been merged first, as if the patchset data is stored differently then it'll need to be updated accordingly. I think we can keep it open and rework it later on if needed.

@gctucker gctucker added the staging-skip Don't test automatically on staging.kernelci.org label Aug 12, 2023
@gctucker
Copy link
Contributor

Adding the staging-skip label to not deploy it on staging yet until other parts of the code are ready (storing patchset information in kernel revision / checkout data etc.).

@yurinnick
Copy link
Contributor Author

@spbnick Patchwork has it's own implementation of patch hashing (hasher.py), which I believe does the trick of generating persistent hash of patch content.

However, it uses sha1 instead of sha256 and does some additional patch parsing. Should we use their implementation for patch hashing, or it's better to ignore it and rehash patches on KernelCi or kernelci-patchwork-webhook side?

@gctucker
Copy link
Contributor

I guess we should first complete the discussion on kernelci/kernelci-api#307 about the schema changes now we know the patch information needs to be in Node.Revision data model? Then once we have a clearer idea of how things will look like on the API side the rest should follow more naturally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-skip Don't test automatically on staging.kernelci.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Patch building and Webhooks API
3 participants