Skip to content

Conversation

@tolusha
Copy link
Contributor

@tolusha tolusha commented Jul 24, 2025

What does this PR do?

Update project dependencies, specifically github.com/operator-framework/api to have ability to set userNamespaceLevel in SCC

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-8320

How to test this PR?

  1. Prepare a patch file if needed:
cat > /tmp/cr-patch.yaml <<EOF
apiVersion: org.eclipse.che/v2
kind: CheCluster
spec: {}
EOF
  1. Deploy the operator:

OpenShift

./build/scripts/olm/test-catalog-from-sources.sh --cr-patch-yaml /tmp/cr-patch.yaml

on Minikube

./build/scripts/minikube-tests/test-operator-from-sources.sh --cr-patch-yaml /tmp/cr-patch.yaml

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@tolusha tolusha force-pushed the updatedependencies branch from d3e7a3c to 340425e Compare July 28, 2025 14:39
@tolusha tolusha force-pushed the updatedependencies branch from 340425e to 2de584b Compare July 28, 2025 15:49
@tolusha tolusha changed the title chore: update project dependencies chore: update project dependencies to the latest versions Jul 28, 2025
@tolusha tolusha changed the title chore: update project dependencies to the latest versions chore: update dependencies to the latest versions Jul 28, 2025
@tolusha
Copy link
Contributor Author

tolusha commented Jul 29, 2025

/retest

tolusha added 3 commits July 29, 2025 16:04
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
check-license-header -f "${LICENSE_TEMPLATE}" ${FILES_TO_CHECK_LICENSE}
dependencies-md-validation:
dependencies-validation:
runs-on: ubuntu-22.04
Copy link
Contributor

@rohanKanojia rohanKanojia Jul 29, 2025

Choose a reason for hiding this comment

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

nit, use latest version of ubuntu runner, either use ubuntu-latest or 24.04 or ubuntu-24.04-arm

Suggested change
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

env:
EXCLUDE_DEPS: "github.com/bmizerany/assert, gotest.tools/v3, github.com/dhui/dktest, gotest.tools, github.com/golangplus/testing"
- name: Checkout source code
uses: actions/checkout@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v3
uses: actions/checkout@v4

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for naive question,
Is DEPENDENCIES.md intentionally removed due to deprecation, redundancy, or is the information tracked elsewhere now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was intentionally removed and replaced by a PR check.
I've added build/scripts/clear-defined-test.sh to automatically check licenses.

cmd/main.go Outdated
os.Exit(1)
}

namespacechace := namespacecache.NewNamespaceCache(nonCachingClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

Suggested change
namespacechace := namespacecache.NewNamespaceCache(nonCachingClient)
namespacecache := namespacecache.NewNamespaceCache(nonCachingClient)

Comment on lines +36 to +37
"github.com/devfile/devworkspace-operator/pkg/infrastructure"
devworkspaceinfra "github.com/devfile/devworkspace-operator/pkg/infrastructure"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, I see IsOpenShift() getting used in this class with these duplicated packages. Is it okay to delete one?

  • infrastructure.IsOpenShift()
  • devworkspaceinfra.IsOpenShift()

Signed-off-by: Anatolii Bazko <[email protected]>
Comment on lines 46 to 99

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, add a permissions block to the workflow file .github/workflows/pr-check.yml. This block should be placed at the top level (before jobs:) to apply to all jobs in the workflow, unless a job requires different permissions. The minimal starting point is contents: read, which allows jobs to read repository contents but not write. If any job requires additional permissions (such as pull-requests: write), those can be added as needed, but based on the current workflow, only read access is required.

Specifically, insert the following block after the name: and on: keys, and before jobs::

permissions:
  contents: read

No additional imports, methods, or definitions are required.

Suggested changeset 1
.github/workflows/pr-check.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -14,2 +14,4 @@
 on: pull_request
+permissions:
+  contents: read
 jobs:
EOF
@@ -14,2 +14,4 @@
on: pull_request
permissions:
contents: read
jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +100 to +105

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the problem, add a permissions block at the top level of the workflow file (.github/workflows/pr-check.yml), just below the name: and before the on: key. This will apply the specified permissions to all jobs in the workflow unless overridden at the job level. The minimal recommended permissions are contents: read, which allows jobs to read repository contents but not write to them. If any job needs to write to pull requests (e.g., to post comments or statuses), you can add pull-requests: write, but based on the provided steps, only contents: read is required. No additional imports or definitions are needed.

Suggested changeset 1
.github/workflows/pr-check.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -13,2 +13,4 @@
 name: PR check
+permissions:
+  contents: read
 on: pull_request
EOF
@@ -13,2 +13,4 @@
name: PR check
permissions:
contents: read
on: pull_request
Copilot is powered by AI and may make mistakes. Always verify output.
@tolusha
Copy link
Contributor Author

tolusha commented Jul 30, 2025

Remarks have been fixed.
Thank you for review.

@tolusha
Copy link
Contributor Author

tolusha commented Jul 30, 2025

/retest

t.Fatalf("Failed to update the manager in the fake client: %s", err)
}
// It is not possible to update readonly field
//manager.DeletionTimestamp = &metav1.Time{Time: time.Now()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to simulate deletion by calling client.Delete() instead of manually setting .DeletionTimestamp?

Does the fake client automatically set .DeletionTimestamp when Delete() is called, or would we need to mock that behavior manually for finalizer testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the hint.
Fake client does set DeletionTimestamp, the test was updated accordingly.

@openshift-ci openshift-ci bot added the lgtm label Jul 30, 2025
@rohanKanojia rohanKanojia removed their assignment Jul 30, 2025
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rohanKanojia, tolusha

The full list of commands accepted by this bot can be found 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

Signed-off-by: Anatolii Bazko <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm label Jul 30, 2025
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2025

New changes are detected. LGTM label has been removed.

@tolusha
Copy link
Contributor Author

tolusha commented Jul 30, 2025

/retest

@tolusha
Copy link
Contributor Author

tolusha commented Jul 30, 2025

It seems ci/prow/v19-devworkspace-happy-path job is quite unstable.
Local results are fine:

  9 passing (4m)
...
[INFO] Happy-path test succeed.
[INFO] Happy-path execution took 368.911734906 seconds.

@tolusha tolusha merged commit 6d33703 into main Jul 30, 2025
31 of 33 checks passed
@tolusha tolusha deleted the updatedependencies branch July 30, 2025 12:28
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.

4 participants