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

Add event context #5295

Merged
merged 5 commits into from
Oct 25, 2024
Merged

Add event context #5295

merged 5 commits into from
Oct 25, 2024

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Oct 25, 2024

What this PR does:

Modified the pipectl event register command to allow adding metadata to events.
The metadata added to events will be included as trailers in commits created by the event watcher.

How to

  • When the event watcher creates a commit, it adds the values of the contexts attached to the event as trailers
  • PIpeCD only references the manifest repo, so it was necessary to add information to the manifest repo

Why we need it:
We want to check the source code links from the commits in the manifest repo.

Which issue(s) this PR fixes:

Part of #5028

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

t-kikuc
t-kikuc previously approved these changes Oct 25, 2024
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

good

Signed-off-by: Yoshiki Fujikane <[email protected]>
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

👍🏻

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 20.58824% with 27 lines in your changes missing coverage. Please review.

Project coverage is 24.39%. Comparing base (4ebcb7c) to head (9c9aff8).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/piped/eventwatcher/eventwatcher.go 0.00% 8 Missing ⚠️
pkg/app/pipedv1/eventwatcher/eventwatcher.go 0.00% 8 Missing ⚠️
pkg/app/pipectl/cmd/event/register.go 0.00% 5 Missing ⚠️
pkg/git/gittest/git.mock.go 0.00% 4 Missing ⚠️
pkg/app/server/grpcapi/api.go 0.00% 1 Missing ⚠️
pkg/git/repo.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5295      +/-   ##
==========================================
+ Coverage   24.37%   24.39%   +0.01%     
==========================================
  Files         443      443              
  Lines       46927    46936       +9     
==========================================
+ Hits        11439    11449      +10     
+ Misses      34577    34576       -1     
  Partials      911      911              

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

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ffjlabo ffjlabo merged commit 6cc8e88 into master Oct 25, 2024
17 of 18 checks passed
@ffjlabo ffjlabo deleted the add-event-context branch October 25, 2024 09:06
@ffjlabo
Copy link
Member Author

ffjlabo commented Oct 29, 2024

📝 The sample for how the GitHub shows the trailers

  1. Execute pipectl event register with --contexts option. We can set some values for the event.
pipectl event register --address=xxx --api-key=xxx --name=simple --data="gcr.io/pipecd/helloworld:v0.49.0" --contexts=Source-Commit-Hash= 6512b1f3fcba7342c11cf96968e753c78e66561b,Source-URL=https://github.com/pipe-cd/pipecd/commit/6512b1f3fcba7342c11cf96968e753c78e66561b,PipeCD-Official-Docs=https://pipecd.dev/
  1. Event Watcher makes a commit and sets these values as trailers.
commit 5fd3fdb367ac048fcae8533c5ea76d62e8e8998f (HEAD -> main, origin/main, origin/HEAD)
Author: Yoshiki Fujikane <[email protected]>
Date:   Mon Oct 28 15:45:55 2024 +0900

    Update image version

    Source-Commit-Hash: 6512b1f3fcba7342c11cf96968e753c78e66561b
    Source-URL: https://github.com/pipe-cd/pipecd/commit/6512b1f3fcba7342c11cf96968e753c78e66561b
    PipeCD-Official-Docs: https://pipecd.dev/

Update_image_version_·_ca-dp_ffjlabo-dev_5fd3fdb (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants