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

Change the API to create events to be versioned #77

Merged
merged 2 commits into from
May 2, 2024

Conversation

afrittoli
Copy link
Contributor

@afrittoli afrittoli commented May 1, 2024

Do a few changes in preparation for support of multiple versions:

  • relocate the spec submodule to be versioned (by spec version)
  • add the even version in event types

This has an impact on the API, so what used to be:

event, _ := cdevents.NewPipelineRunQueuedEvent()

Will become instead:

event, _ := cdevents.NewPipelineRunQueuedEventV0_1_1()

The parsing and rendering APIs do not change.
Upcoming PRs will add objects to identify the collection of event versions that belong to a specific spec version, to let users select the spec version rather than having to pick individual event versions.

@afrittoli afrittoli closed this May 1, 2024
@afrittoli afrittoli reopened this May 1, 2024
@afrittoli afrittoli closed this May 1, 2024
@afrittoli afrittoli reopened this May 1, 2024
Move the submodule and update the generator logic to point
to the new folder. For now only one version is still
supported.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
@afrittoli afrittoli force-pushed the multi_versions branch 4 times, most recently from 70602b2 to b569cbf Compare May 2, 2024 11:31
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 87.37327% with 137 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@df9a2db). Click here to learn what that means.

Files Patch % Lines
tools/generator.go 7.14% 13 Missing ⚠️
pkg/api/zz_testcaserunfinished_0_1_0.go 79.31% 6 Missing ⚠️
pkg/api/zz_testcaserunqueued_0_1_0.go 85.18% 4 Missing ⚠️
pkg/api/zz_testcaserunstarted_0_1_0.go 85.18% 4 Missing ⚠️
pkg/api/zz_testoutputpublished_0_1_0.go 85.18% 4 Missing ⚠️
pkg/api/zz_artifactpackaged_0_1_1.go 87.50% 3 Missing ⚠️
pkg/api/zz_artifactpublished_0_1_1.go 86.95% 3 Missing ⚠️
pkg/api/zz_artifactsigned_0_1_0.go 87.50% 3 Missing ⚠️
pkg/api/zz_branchcreated_0_1_2.go 87.50% 3 Missing ⚠️
pkg/api/zz_branchdeleted_0_1_2.go 87.50% 3 Missing ⚠️
... and 31 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #77   +/-   ##
=======================================
  Coverage        ?   80.05%           
=======================================
  Files           ?       46           
  Lines           ?     3164           
  Branches        ?        0           
=======================================
  Hits            ?     2533           
  Misses          ?      524           
  Partials        ?      107           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add the event version name in the generated filename as well
as in the type names, so that we may host different versions
within the SDK.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
@afrittoli afrittoli changed the title Relocate spec submodule to versioned path Change the API to create events to be versioned May 2, 2024
@afrittoli afrittoli added this to the v0.4 milestone May 2, 2024
@afrittoli afrittoli added this pull request to the merge queue May 2, 2024
Merged via the queue into cdevents:main with commit 48d994a May 2, 2024
7 checks passed
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.

1 participant