Skip to content

refactor(invoke): simplify extension map iteration - #3913

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
shreyaabaranwal:fix/invoke-range-loop
Oct 30, 2026
Merged

knative-prow[bot] merged 1 commit into
knative:mainfrom
shreyaabaranwal:fix/invoke-range-loop

Conversation

@shreyaabaranwal

@shreyaabaranwal shreyaabaranwal commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Use for k, v := range instead of indexed map lookup when setting CloudEvent extensions.

Changes

  • Simplify CloudEvent extension iteration using for k, v := range instead of looking up each value by key

/kind cleanup

Relates to #3346

Release Note


Docs


Use 'for k, v := range' instead of indexed map lookup when setting
CloudEvent extensions.

Signed-off-by: shreyaabaranwal <shreyabaranwal229@gmail.com>
@knative-prow knative-prow Bot added the kind/cleanup Cleanup label Jun 20, 2026
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos June 20, 2026 07:45
@knative-prow knative-prow Bot added size/XS 🤖 PR changes 0-9 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels Jun 20, 2026
@knative-prow

knative-prow Bot commented Jun 20, 2026

Copy link
Copy Markdown

Hi @shreyaabaranwal. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@shreyaabaranwal

Copy link
Copy Markdown
Contributor Author

/kind cleanup

@codecov

codecov Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.03%. Comparing base (7e06f8e) to head (193203f).
⚠️ Report is 134 commits behind head on main.

Files with missing lines Patch % Lines
pkg/functions/invoke.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3913      +/-   ##
==========================================
+ Coverage   52.49%   53.03%   +0.54%     
==========================================
  Files         200      200              
  Lines       23687    23687              
==========================================
+ Hits        12434    12563     +129     
+ Misses      10030     9900     -130     
- Partials     1223     1224       +1     
Flag Coverage Δ
e2e 21.59% <0.00%> (-0.08%) ⬇️
e2e go 29.39% <0.00%> (ø)
e2e node 25.72% <0.00%> (ø)
e2e python 29.72% <0.00%> (ø)
e2e quarkus 25.85% <0.00%> (-0.01%) ⬇️
e2e rust 25.32% <0.00%> (ø)
e2e springboot 24.00% <0.00%> (ø)
e2e typescript 25.83% <0.00%> (ø)
e2e-config-ci 26.90% <0.00%> (ø)
integration 15.69% <0.00%> (-0.02%) ⬇️
unit macos-14 43.05% <0.00%> (ø)
unit macos-latest 43.05% <0.00%> (ø)
unit ubuntu-24.04-arm 43.37% <0.00%> (ø)
unit ubuntu-latest 43.90% <0.00%> (-0.02%) ⬇️
unit windows-latest 43.12% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shreyaabaranwal

Copy link
Copy Markdown
Contributor Author

The E2E failure looks unrelated to this PR — TestCore_PythonUserDepsRemote fails with an image-not-found error caused by git describe failing in CI (FUNC_VERSION ends up unset). This PR only changes invoke extension map iteration. Could a maintainer re-run the job?
Thanks! 🙏

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors CloudEvent extension assignment during func invoke by simplifying map iteration in sendEvent, keeping behavior the same while making the code clearer and slightly more efficient.

Changes:

  • Replace “range keys then index into map” with for k, v := range m.Extensions when setting CloudEvent extensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lkingland

Copy link
Copy Markdown
Member

Thanks @shreyaabaranwal!

/ok-to-test
/lgtm
/approve

@knative-prow knative-prow Bot added the ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. label Oct 30, 2026
@knative-prow knative-prow Bot added lgtm 🤖 PR is ready to be merged. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels Oct 30, 2026
@knative-prow

knative-prow Bot commented Oct 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, shreyaabaranwal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Oct 30, 2026
@lkingland lkingland closed this Oct 30, 2026
@lkingland lkingland reopened this Oct 30, 2026
@knative-prow
knative-prow Bot merged commit d5ce2c2 into knative:main Oct 30, 2026
109 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/cleanup Cleanup lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/XS 🤖 PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants