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

Define top level Permission for ci-schedule-compatibility workflow #5068

Conversation

aditya7302
Copy link
Contributor

@aditya7302 aditya7302 commented Jun 20, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:
Part of #5048

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 20, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 20, 2024
@zhzhuang-zju
Copy link
Contributor

@aditya7302 goog job~
Since this ci is executed periodically and is not running this time, have you tried to see if you can run this workflow properly with modified permissions?

@aditya7302
Copy link
Contributor Author

@zhzhuang-zju I am trying to run this workflow on my local to test it but I couldn't figure it out.

@zhzhuang-zju
Copy link
Contributor

@zhzhuang-zju I am trying to run this workflow on my local to test it but I couldn't figure it out.

You can post the link to your local test.

@aditya7302
Copy link
Contributor Author

aditya7302 commented Jun 21, 2024

Here is the link of the APIServer compatibility workflow(ci-schedule-compatibility.yaml) run with modified permissions : https://github.com/aditya7302/karmada/actions/runs/9611101767

@RainbowMango
Copy link
Member

/assign @zhzhuang-zju

@zhzhuang-zju
Copy link
Contributor

zhzhuang-zju commented Jun 25, 2024

/lgtm
cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2024
Comment on lines 10 to 11
deployments: write # Needed to manage deployments for setting up the test environment.
statuses: read # Necessary to check the status of deployments before running tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

@aditya7302 Can you explain the reason for adding these two permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zhzhuang-zju
deployments: write ->This permission is necessary to manage deployments for setting up the test environment. We need to update the images which involves setting up new images. This requires write access to deployments.

- name: change kube-apiserver and kube-controller-manager version
  run: |
    kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
      set image deployment/karmada-apiserver -nkarmada-system \
      karmada-apiserver=registry.k8s.io/kube-apiserver:${{ matrix.kubeapiserver-version }}
    kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
      set image deployment/karmada-kube-controller-manager -nkarmada-system \
      kube-controller-manager=registry.k8s.io/kube-controller-manager:${{ matrix.kubeapiserver-version }}

statuses: read ->This permission is essential to check the status of deployments before running tests.

kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
  rollout status deployment/karmada-kube-controller-manager -nkarmada-system --timeout=5m
kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
  rollout status deployment/karmada-apiserver -nkarmada-system --timeout=5m

Copy link
Contributor

Choose a reason for hiding this comment

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

Refer to https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs, permission deployment and statused are not actually a k8s concept. We might don't need those two permissions. Can you remove those two permissions and try it out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zhzhuang-zju here is the APIServer compatibility workflow run without deployments: write and statuses: read permissions : https://github.com/aditya7302/karmada/actions/runs/9694680710.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've tried this locally and had similar results to yours, a couple of jobs would fail. Might have to configure out the reason for that

Copy link
Contributor

Choose a reason for hiding this comment

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

@aditya7302 It looks like it's all failing at step change kube-apiserver and kube-controller-manager version. @liangyuanpeng is trying to remove that step, so we can wait for his part of the work to be done before defining top level permission for ci -schedule-compatibility workflow, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also think that some jobs are failing at step change kube-apiserver and kube-controller-manager version. I will wait for @liangyuanpeng to remove this step and until then I will look for other good-first and help-wanted issues to work on.

Copy link
Contributor

@liangyuanpeng liangyuanpeng Jul 3, 2024

Choose a reason for hiding this comment

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

This is pending with #4929 before open a PR to working for update remove the step change kube-apiserver and kube-controller-manager version

Copy link
Contributor

Choose a reason for hiding this comment

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

#5142 is merged and please go ahead!

Copy link
Member

Choose a reason for hiding this comment

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

kindly ping @aditya7302
It seems @zhzhuang-zju is suggesting removing some permissions as per #5068 (comment).

@zhzhuang-zju
Copy link
Contributor

kindly ping @aditya7302

Signed-off-by: aditya7302 <aditya7302@gmail.com>
@RainbowMango RainbowMango force-pushed the ci-schedule-compatibility-token-permission branch from bce8c21 to 284b9de Compare August 6, 2024 04:07
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2024
@RainbowMango
Copy link
Member

Helped rebase and addressed the comments. Please take another look. @zhzhuang-zju

@zhzhuang-zju
Copy link
Contributor

thanks~
/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2024
@codecov-commenter
Copy link

⚠️ 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 28.39%. Comparing base (4124ba8) to head (284b9de).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5068      +/-   ##
==========================================
+ Coverage   28.38%   28.39%   +0.01%     
==========================================
  Files         632      632              
  Lines       43798    43798              
==========================================
+ Hits        12431    12436       +5     
+ Misses      30462    30459       -3     
+ Partials      905      903       -2     
Flag Coverage Δ
unittests 28.39% <ø> (+0.01%) ⬆️

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

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

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

The pull request process is described here

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2024
@karmada-bot karmada-bot merged commit 19f3529 into karmada-io:master Aug 6, 2024
12 checks passed
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants