-
Notifications
You must be signed in to change notification settings - Fork 715
ci: add complete sha in dispatch params #8765
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
Conversation
Signed-off-by: Yashodhan Joshi <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
This PR enhances the GitHub Actions workflow that triggers enterprise builds by adding the complete commit SHA to the dispatch payload. The change modifies the `dispatch-event-enterprise.yml` workflow to include both the existing 7-character short commit ID and a new full 40-character commit SHA in the payload sent to the enterprise repository.The implementation adds a new environment variable COMMIT_ID that captures the complete GITHUB_HEAD_SHA and includes it as o2_full_commit in the client payload JSON alongside the existing o2_commit_id field. This change maintains backward compatibility while providing downstream enterprise build processes with access to the complete SHA for more precise git operations, verification, or tracking purposes.
The modification integrates seamlessly with the existing workflow structure, following the same pattern used for setting the short commit ID. The workflow continues to authenticate via GitHub App tokens, dispatch events to the openobserve/o2-enterprise repository, and pass branch information as before.
PR Description Notes:
- Contains a typo: "addition" should be "additional"
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| .github/workflows/dispatch-event-enterprise.yml | 4/5 | Adds full commit SHA to enterprise build dispatch payload alongside existing short SHA |
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only adds data to an existing payload without breaking changes
- Score reflects straightforward implementation following existing patterns with minor formatting inconsistency
- Pay attention to the JSON formatting inconsistency in the client-payload where spacing varies around colons
Sequence Diagram
sequenceDiagram
participant User
participant "GitHub PR" as PR
participant "CI Workflow" as CI
participant "GitHub Secrets" as Secrets
participant "GitHub App" as App
participant "Enterprise Repo" as Enterprise
User->>PR: "Create pull request"
PR->>CI: "Trigger workflow (pull_request event)"
Note over CI: Check if PR is not from fork
CI->>Secrets: "Request PRIVATE_KEY and APP_ID"
Secrets-->>CI: "Return secrets"
CI->>App: "Generate GitHub App token"
App-->>CI: "Return installation access token"
CI->>CI: "Extract SHORT_COMMIT_ID (first 7 chars)"
CI->>CI: "Set COMMIT_ID (full SHA)"
CI->>CI: "Log SHORT_COMMIT_ID for confirmation"
CI->>Enterprise: "Dispatch repository event"
Note over Enterprise: Event payload contains:<br/>- o2_enterprise_repo<br/>- o2_opensource_repo<br/>- o2_commit_id (short)<br/>- o2_full_commit (full SHA)
Enterprise-->>CI: "Acknowledge dispatch"
1 file reviewed, 1 comment
| repository: openobserve/o2-enterprise | ||
| event-type: initiate-enterprise-build | ||
| client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}"}' | ||
| client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}", "o2_full_commit":"${{env.COMMIT_ID}}"}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Inconsistent spacing in JSON payload - missing space after colon in "o2_full_commit": while other properties have spaces
| client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}", "o2_full_commit":"${{env.COMMIT_ID}}"}' | |
| client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}", "o2_full_commit": "${{ env.COMMIT_ID }}"}' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/dispatch-event-enterprise.yml
Line: 44:44
Comment:
**style:** Inconsistent spacing in JSON payload - missing space after colon in `"o2_full_commit":` while other properties have spaces
```suggestion
client-payload: '{"o2_enterprise_repo": "${{ env.BRANCH_NAME }}", "o2_opensource_repo": "${{ env.BRANCH_NAME }}" ,"o2_commit_id": "${{ env.SHORT_COMMIT_ID }}", "o2_full_commit": "${{ env.COMMIT_ID }}"}'
```
How can I resolve this? If you propose a fix, please make it concise.
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
WIP PR for adding an addition key in the dispatch payload for the full sha
PR Type
Enhancement
Description
Include full commit SHA in env
Extend dispatch payload with full SHA
Preserve short SHA usage for compatibility
Diagram Walkthrough
File Walkthrough
dispatch-event-enterprise.yml
Add full SHA to workflow env and payload.github/workflows/dispatch-event-enterprise.yml
COMMIT_IDwith full SHA to envo2_full_committo dispatchclient-payloado2_commit_id