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

Wizard: switch snapshot date in wizard to RFC3339 #2526

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

xbhouse
Copy link
Contributor

@xbhouse xbhouse commented Oct 18, 2024

The changes here should format the requested date from YYYY-MM-DD to RFC3339 in the snapshot step of the wizard. This helps content-sources clean up some tech debt and allows us to use RFC3339 for all date formats in our template-related APIs.

Background:
This PR removed support for YYYY-MM-DD in the request for /snapshots/for_date/ and broke things. The snapshot step in the wizard needed to be converted to use RFC3339 also. This commit has been reverted and things are good again.

Without these changes in the wizard, errors like this would be seen when calling /snapshots/for_date/ from the content sources API with an unsupported date format:

parsing time \"2024-10-18\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"T\", internal=parsing time \"2024-10-18\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"T\" \n

@app-sre-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@xbhouse xbhouse changed the title fix: snapshot date in wizard should now be RFC3339 Wizard: snapshot date in wizard should now be RFC3339 Oct 22, 2024
@xbhouse
Copy link
Contributor Author

xbhouse commented Oct 22, 2024

issue here

src/Utilities/time.ts Outdated Show resolved Hide resolved
Copy link
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

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

Thank you!

Could you edit the commit message? The PR title is good. https://osbuild.org/docs/developer-guide/general/workflow#preferred-commit-message-format

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.86%. Comparing base (e593445) to head (94326cb).
Report is 1 commits behind head on main.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2526      +/-   ##
==========================================
- Coverage   84.86%   84.86%   -0.01%     
==========================================
  Files         183      183              
  Lines       20777    20783       +6     
  Branches     2016     2018       +2     
==========================================
+ Hits        17633    17638       +5     
- Misses       3122     3123       +1     
  Partials       22       22              
Files with missing lines Coverage Δ
...teImageWizard/steps/Review/ReviewStepTextLists.tsx 94.64% <100.00%> (+0.01%) ⬆️
...ents/CreateImageWizard/steps/Snapshot/Snapshot.tsx 97.29% <100.00%> (-0.08%) ⬇️
src/store/wizardSlice.ts 89.10% <100.00%> (+0.09%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e593445...94326cb. Read the comment docs.

@xbhouse xbhouse force-pushed the fix-snapshot-date branch 4 times, most recently from c9606f1 to 723bb0f Compare October 24, 2024 18:06
@xbhouse
Copy link
Contributor Author

xbhouse commented Oct 24, 2024

@croissanne this is ready for another review when you have a chance!

also, you mentioned image-builder needing an update to move from YYYY-MM-DD to RFC3339 too? let me know if there is anywhere else that will need a change as well, tracking them all here

@xbhouse xbhouse changed the title Wizard: snapshot date in wizard should now be RFC3339 Wizard: switch snapshot date in wizard to RFC3339 Nov 20, 2024
@xbhouse xbhouse requested a review from croissanne November 20, 2024 14:01
@ochosi
Copy link
Contributor

ochosi commented Nov 22, 2024

Looks like this has been stale for a bit, but it also seems to me that this should still be addressed, no?

@xbhouse
Copy link
Contributor Author

xbhouse commented Nov 25, 2024

@ochosi agreed, this lets us remove some tech debt from content-sources. i believe there are some changes needed in image-builder and maybe IQE tests too? i'm not sure which would need to be merged first. CC @croissanne

Copy link
Collaborator

@regexowl regexowl left a comment

Choose a reason for hiding this comment

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

Hey @xbhouse this looks great, thank you! pr_check is passing so IQE should be hopefully fine. @jrusz what do you think? Could changing the snapshot date format break something outside of pr_check? As for API, it looks like we're all set there: osbuild/image-builder#1252

src/Utilities/time.ts Outdated Show resolved Hide resolved
@jrusz
Copy link
Collaborator

jrusz commented Nov 27, 2024

Hey @xbhouse this looks great, thank you! pr_check is passing so IQE should be hopefully fine. @jrusz what do you think? Could changing the snapshot date format break something outside of pr_check? As for API, it looks like we're all set there: osbuild/image-builder#1252

We have a specific function to convert between the api and ui format in IQE plugin so it will most likely need some adjustment, that's going to be an easy change though

@regexowl
Copy link
Collaborator

regexowl commented Dec 3, 2024

@xbhouse Could you please squash the commits and rebase? The changes look great ✨

@jrusz @tkoscieln This will be good to merge, could you please take a look at what changes will be needed and let me know when they're ready?

@tkoscieln
Copy link
Contributor

@jrusz @tkoscieln This will be good to merge, could you please take a look at what changes will be needed and let me know when they're ready?

Let me catch up on this change and I'll make the adjustment in IQE tests

@jrusz
Copy link
Collaborator

jrusz commented Dec 4, 2024

/retest

@tkoscieln
Copy link
Contributor

@xbhouse It seems this is not ready to merge yet. I tested it out and got a 500 code when trying to start the composes with a following error:

"errors": [
    {
      "detail": "Unable to build customizations: code=400, message=Snapshot date 2024-12-03T00:00:00.000Z is not in DateOnly (yyyy-mm-dd) format",
      "title": "500"
    }
  ]
  

@regexowl produced a fix for it here in backend.

@xbhouse
Copy link
Contributor Author

xbhouse commented Dec 4, 2024

@xbhouse It seems this is not ready to merge yet. I tested it out and got a 500 code when trying to start the composes with a following error:

"errors": [
    {
      "detail": "Unable to build customizations: code=400, message=Snapshot date 2024-12-03T00:00:00.000Z is not in DateOnly (yyyy-mm-dd) format",
      "title": "500"
    }
  ]
  

@regexowl produced a fix for it here in backend.

ooh ok, nice catch! thank you ❤️

Copy link
Contributor

github-actions bot commented Jan 4, 2025

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 4, 2025
@regexowl regexowl removed the Stale label Jan 6, 2025
@regexowl
Copy link
Collaborator

regexowl commented Jan 6, 2025

The backend fix got merged! Trying to compose an image and all looks good so far. @tkoscieln could you please take a look at the IQE test adjustment?

@tkoscieln
Copy link
Contributor

@regexowl I tested it out, the compose works fine and I tried running the integration tests on it (as those are the ones that test the snapshotting) and they passed fine, so it seems this change is good to go.

@regexowl
Copy link
Collaborator

regexowl commented Jan 7, 2025

@tkoscieln Excellent, thank you! I'd say we're ready to merge then.

@regexowl regexowl dismissed croissanne’s stale review January 7, 2025 12:59

I believe everything was addressed.

Copy link
Collaborator

@regexowl regexowl left a comment

Choose a reason for hiding this comment

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

Thank you! ❤️

@regexowl regexowl enabled auto-merge (rebase) January 7, 2025 13:00
@regexowl regexowl merged commit 29736d8 into osbuild:main Jan 7, 2025
7 checks passed
@xbhouse
Copy link
Contributor Author

xbhouse commented Jan 9, 2025

thank you all for your help on this!! i'm going to switch the date format to just RFC3339 in content-sources next (currently we're supporting both RFC3339 and YYYY-MM-DD), so once that's merged i'll monitor for any issues but hopefully everything goes smoothly 🙏

@regexowl
Copy link
Collaborator

regexowl commented Jan 9, 2025

Thank you! Please let me know if anything seems amiss.

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.

7 participants