Skip to content

[WIP] Introducing v1experimental#4279

Closed
slinkydeveloper wants to merge 2 commits into
knative:mainfrom
slinkydeveloper:experimental_features
Closed

[WIP] Introducing v1experimental#4279
slinkydeveloper wants to merge 2 commits into
knative:mainfrom
slinkydeveloper:experimental_features

Conversation

@slinkydeveloper
Copy link
Copy Markdown
Contributor

@slinkydeveloper slinkydeveloper commented Oct 12, 2020

Signed-off-by: Francesco Guardiani francescoguard@gmail.com

Testing the feasibility of the idea from https://docs.google.com/document/d/1jluAYCJi6kq6HBmR7uMRUB7Zxcf1v6qjR3-pw0gMTRU/edit?usp=sharing

This PR introduces a new api group version called v1experimental. This api group is not stored and the webhook converts it back to v1, in order to avoid duplicating controller code. Experimental code, through api conversion, can retrieve the experimental fields. This PR implements the "compile time feature gates" aka the experimental features code is not compiled in stable releases.

This is how you use the experimental feature in the controller https://github.com/knative/eventing/pull/4279/files#diff-8ae7187e03db920a4f61e06aa3bcbbbe

This is how the v1experimental looks like when it's stored:

Name:         my-service-trigger
Namespace:    default
Labels:       eventing.knative.dev/broker=default
Annotations:  eventing.knative.dev/creator: kubernetes-admin
              eventing.knative.dev/lastModifier: kubernetes-admin
              v1experimental/expression: helloworld
API Version:  eventing.knative.dev/v1
Kind:         Trigger
Metadata:
  Creation Timestamp:  2020-10-12T08:39:35Z
  Generation:          1
  Managed Fields:
    API Version:  eventing.knative.dev/v1experimental
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:broker:
        f:filter:
          .:
          f:expression:
        f:subscriber:
          .:
          f:ref:
            .:
            f:apiVersion:
            f:kind:
            f:name:
    Manager:      kubectl-client-side-apply
    Operation:    Update
    Time:         2020-10-12T08:39:35Z
    API Version:  eventing.knative.dev/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        f:conditions:
        f:observedGeneration:
    Manager:         mtchannel_broker
    Operation:       Update
    Time:            2020-10-12T08:39:35Z
  Resource Version:  16802
  Self Link:         /apis/eventing.knative.dev/v1/namespaces/default/triggers/my-service-trigger
  UID:               6503fe3e-0e14-4ab9-bca7-02dde28f5325
Spec:
  Broker:  default
  Filter:
  Subscriber:
    Ref:
      API Version:  serving.knative.dev/v1
      Kind:         Service
      Name:         my-service
      Namespace:    default

As you can see, annotations are used to store v1experimental fields

Proposed Changes

  • New experimental API group called v1experimental
  • New feature build flag called js_trigger_filter (just for demonstration purpose)

Problems

  • deepcopy-gen doesn't like golang tags. This has to be fixed before shipping this PR
TBD

Docs

TBD

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 12, 2020
@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 12, 2020
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 12, 2020
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Oct 12, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: slinkydeveloper

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-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 12, 2020

Codecov Report

Merging #4279 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4279   +/-   ##
=======================================
  Coverage   80.36%   80.37%           
=======================================
  Files         288      289    +1     
  Lines        7910     7912    +2     
=======================================
+ Hits         6357     6359    +2     
  Misses       1172     1172           
  Partials      381      381           
Impacted Files Coverage Δ
...g/reconciler/mtbroker/trigger/expression_stable.go 100.00% <100.00%> (ø)
pkg/reconciler/mtbroker/trigger/trigger.go 73.28% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0889429...0c66be1. Read the comment docs.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2020
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2020
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/mtbroker/trigger/expression_stable.go Do not exist 100.0%
pkg/reconciler/mtbroker/trigger/trigger.go 80.0% 80.2% 0.2

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

@slinkydeveloper: PR needs rebase.

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/test-infra repository.

@github-actions
Copy link
Copy Markdown
Contributor

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 19, 2021
Base automatically changed from master to main March 8, 2021 17:40
@knative-prow-robot
Copy link
Copy Markdown
Contributor

@slinkydeveloper: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-upgrade-tests 0c66be1 link /test pull-knative-eventing-upgrade-tests
pull-knative-eventing-go-coverage 0c66be1 link /test pull-knative-eventing-go-coverage
pull-knative-eventing-reconciler-tests 0c66be1 link /test pull-knative-eventing-reconciler-tests

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@github-actions github-actions Bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 24, 2021
@pierDipi
Copy link
Copy Markdown
Member

pierDipi commented May 31, 2021

Can we close this one since we've adopted #5404?

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants