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

Use values in relationship To/From fields #2871

Merged
merged 9 commits into from
May 14, 2024
Merged

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented May 14, 2024

Related to anchore/grype#1857

This PR adjusts all locations where we are writing references into the To and From fields of the artifact.Relationship type such that no variable references are used in those fields. This allows for consumers to more easily type assert out specific elements without having to also check references for those types.

A new ruleguard linter rule has been introduced to help prevent from this occurring in the future.

While fixing the test for this it became apparent that lifting up cmp.Diff options to a common package would be useful, thus the internal/cmptest package was created (should only be used in testing).

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman requested a review from a team May 14, 2024 15:01
@wagoodman wagoodman added the bug Something isn't working label May 14, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review May 14, 2024 15:03
@wagoodman wagoodman self-assigned this May 14, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 048df17 into main May 14, 2024
11 checks passed
@wagoodman wagoodman deleted the values-for-relationships branch May 14, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants