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

feat: allow to disable editor notifications (#763) #790

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Oct 2, 2024

fixes #763

@adietish adietish self-assigned this Oct 2, 2024
@adietish adietish force-pushed the issue-763 branch 5 times, most recently from 0c4f8e2 to c6c12ad Compare October 2, 2024 19:17
@adietish adietish changed the title feat: implemented settings to disable editor push notification (#763) feat: allow to disable editor notifications (#763) Oct 2, 2024
@adietish adietish force-pushed the issue-763 branch 6 times, most recently from 52f25ff to 7fff71f Compare October 4, 2024 09:40
@adietish adietish requested a review from sbouchet October 4, 2024 09:49
@adietish adietish marked this pull request as ready for review October 4, 2024 09:49
@adietish
Copy link
Collaborator Author

adietish commented Oct 4, 2024

@sbouchet:

How to test this:
#763 (comment) is describing what's provided in this enhancement/feature.

My first question is: is the label for the checkbox explaining what happens if you check/uncheck it?

The most basic is test could look like this:

Steps:

  1. ASSERT: make sure that editor sync is enabled in the settings
  2. EXEC: create a new yaml file and copy & paste the following into it:
apiVersion: v1
kind: ConfigMap
metadata:
  name: base64encoded
data:
  foo: text value that noone ca
binaryData:
  bar: jmjKxUGNs/WqDQ==
  1. ASSERT: editor displays a notification telling you that you can push the editor to the cluster
  2. EXEC: go to settings and uncheck "Sync editor with cluster", then Apply/OK
  3. ASSERT: notification disappears
  4. EXEC: hit the push icon in the toolbar

Result:
The config map in the editor was created on the cluster. You are told by a notification.
In the resource tree you now have a new config map named "base64encoded"

Further tests could be done with a multi-resource file and minikube. Multi-resource editors are not notified of the success of the push.

---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
    app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
  labels:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: code-with-quarkus
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: code-with-quarkus
      app.kubernetes.io/version: 1.0.0-SNAPSHOT
  template:
    metadata:
      annotations:
        app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
        app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
      labels:
        app.kubernetes.io/name: code-with-quarkus
        app.kubernetes.io/version: 1.0.0-SNAPSHOT
    spec:
      containers:
        - env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          image: minikube/andredietisheim/code-with-quarkus:1.0.0-SNAPSHOT
          imagePullPolicy: IfNotPresent
          name: code-with-quarkus
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
    app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
  labels:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: code-with-quarkus
spec:
  ports:
    - name: http
      nodePort: 31995
      port: 80
      protocol: TCP
      targetPort: 8080
  selector:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: NodePort

Copy link

sonarcloud bot commented Oct 6, 2024

Copy link
Contributor

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

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

LGTM. good work !

@adietish adietish merged commit eb2c69b into redhat-developer:main Oct 8, 2024
13 checks passed
@adietish adietish deleted the issue-763 branch October 8, 2024 07:32
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.

Option to disable PushNotification
2 participants