Skip to content

fix(bitbucket-cloud): resolve CEL expression failure on push events#2704

Merged
zakisk merged 1 commit into
tektoncd:mainfrom
zakisk:SRVKP-9635-fix-cel-expr-in-bb-cloud
Apr 27, 2026
Merged

fix(bitbucket-cloud): resolve CEL expression failure on push events#2704
zakisk merged 1 commit into
tektoncd:mainfrom
zakisk:SRVKP-9635-fix-cel-expr-in-bb-cloud

Conversation

@zakisk
Copy link
Copy Markdown
Member

@zakisk zakisk commented Apr 23, 2026

Bitbucket Cloud push events set processedEvent.Event to the string "push", but CEL evaluation expects Event to be a JSON object (map[string]interface{}). This caused all CEL expressions to fail with "cannot unmarshal string into Go value of type map[string]interface{}". Remove the incorrect Event assignment and use triggertype constants for TriggerTarget and EventType.

Assisted-by: Claude Opus 4.6 (via Claude Code)

📝 Description of the Change

🔗 Linked GitHub Issue

Fixes #2335

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

@zakisk zakisk force-pushed the SRVKP-9635-fix-cel-expr-in-bb-cloud branch from 5216da0 to f4c95c1 Compare April 23, 2026 13:21
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors Bitbucket Cloud payload parsing to use typed trigger constants and introduces a new E2E test for CEL expressions on push events. It also refactors test helpers to support push-only scenarios by separating branch creation from pull request creation and updating the teardown logic to handle cases without a pull request number. I have no feedback to provide.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.00%. Comparing base (6b69972) to head (f4c95c1).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2704      +/-   ##
==========================================
- Coverage   59.00%   59.00%   -0.01%     
==========================================
  Files         208      208              
  Lines       20436    20435       -1     
==========================================
- Hits        12059    12058       -1     
  Misses       7603     7603              
  Partials      774      774              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zakisk zakisk force-pushed the SRVKP-9635-fix-cel-expr-in-bb-cloud branch from f4c95c1 to 3bee419 Compare April 27, 2026 10:30
Copy link
Copy Markdown
Member

@theakshaypant theakshaypant left a comment

Choose a reason for hiding this comment

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

LGTM

Bitbucket Cloud push events set processedEvent.Event to the string
"push", but CEL evaluation expects Event to be a JSON object
(map[string]interface{}). This caused all CEL expressions to fail
with "cannot unmarshal string into Go value of type
map[string]interface{}". Remove the incorrect Event assignment and
use triggertype constants for TriggerTarget and EventType.

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
@zakisk zakisk force-pushed the SRVKP-9635-fix-cel-expr-in-bb-cloud branch from 3bee419 to e312653 Compare April 27, 2026 11:14
@zakisk zakisk merged commit 68c5f1d into tektoncd:main Apr 27, 2026
11 checks passed
@zakisk zakisk deleted the SRVKP-9635-fix-cel-expr-in-bb-cloud branch April 27, 2026 12:57
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.

bitbucketcloud: cel expression parsing error

3 participants