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

fix(labels): fix broken label file parsing in archive upload modal #1323

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

tthvo
Copy link
Member

@tthvo tthvo commented Aug 10, 2024

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes #1322

Description of the change:

Fixed the incorrect label parsing utility. The labels should be rendered correctly now.

Motivation for the change:

See #1322

image

@tthvo
Copy link
Member Author

tthvo commented Aug 11, 2024

Hmm, I think it comes down to the expected structure of the metadata file. I guess we should have an example in the help icon.

Are we using the previous format { "labels": { "my-key": "my-value" } } or { "labels": [ { "key": "my-key", "value": "my-value" } ] } (same as one downloaded in Recording view)?

@andrewazores
Copy link
Member

Hmm, I think it comes down to the expected structure of the metadata file. I guess we should have an example in the help icon.

I don't think it's really necessary for the help icon to provide an example. The expected purpose here is for the user to just re-upload metadata files they have previously downloaded, so if they need to know the format they can inspect the file directly. Otherwise, it's really just an implementation detail.

Are we using the previous format { "labels": { "my-key": "my-value" } } or { "labels": [ { "key": "my-key", "value": "my-value" } ] } (same as one downloaded in Recording view)?

{ "key": "my-key", "value": "my-value" } should be the new format everywhere, I think. Easier to manage it when we are consistent in every case. A lack of consistency, or checking for consistency, is what gave rise to this bug after all.

@andrewazores andrewazores merged commit 73a7e9e into cryostatio:main Aug 13, 2024
18 checks passed
mergify bot pushed a commit that referenced this pull request Aug 13, 2024
…1323)

Signed-off-by: Thuan Vo <[email protected]>
(cherry picked from commit 73a7e9e)

# Conflicts:
#	src/app/RecordingMetadata/utils.ts
andrewazores added a commit that referenced this pull request Aug 13, 2024
…ackport #1323) (#1327)

* fix(labels): fix broken label file parsing in archive upload modal (#1323)

Signed-off-by: Thuan Vo <[email protected]>
(cherry picked from commit 73a7e9e)

# Conflicts:
#	src/app/RecordingMetadata/utils.ts

* merge conflict

---------

Co-authored-by: Thuan Vo <[email protected]>
Co-authored-by: Andrew Azores <[email protected]>
@tthvo tthvo deleted the label-upload-fix branch August 13, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] Label uploads give incorrect labels in archive upload modal
2 participants