feedback-to-code/mozzarella huggingface dataset:
Repository: provectus/kafka-ui
Issue: Image registry is missing in k8s deployment files
Labels: type/bug
status/accepted
scope/infrastructure
scope/k8s

**Describe the bug**
When using custom private registrys the Helm chart doesn't consider the image registry input.

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Add the following (as an example) in the `values.yml` file:
  ```
  image:
    registry: YOUR_REGISTRY
    repository: kafka-ui
    tag: 0.2.1
  ```
2. Deploy the helm chart to your cluster.
2. The deployment file is missing the registry in the image name.

**Expected behavior**
The image registry should be added to the image name in the k8s `deployment.yml`.

**Fix**
In the template file `deployment.yaml` replace the line for `containers.image` with the following:

```
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
```

Issue comments:
Hello there moritzluedtke! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi, thanks for raising the issue. We'll take a look into this.
@moritzluedtke it will take some time for us to update the chart on artifacthub. It will happen presumably near 19th of December.
@Haarolean no problem, thanks for fixing this! 👍 

Pull request review comments:

Patch that resolved the issue:
diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml
index b1aae57b6fa..0f995b837d8 100644
--- a/charts/kafka-ui/templates/deployment.yaml
+++ b/charts/kafka-ui/templates/deployment.yaml
@@ -36,7 +36,7 @@ spec:
         - name: {{ .Chart.Name }}
           securityContext:
             {{- toYaml .Values.securityContext | nindent 12 }}
-          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+          image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
           imagePullPolicy: {{ .Values.image.pullPolicy }}
           envFrom:
             {{- if .Values.existingConfigMap }}


Test patch:
Repository: provectus/kafka-ui
Issue: Wrong counter value for Connectors
Labels: type/bug
good first issue
scope/frontend
status/accepted
status/confirmed

**Describe the bug**
The counter on the page Connectors displays the wrong value (always "1")


**Set up**
(How do you run the app? 
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
http://redesign.internal.kafka-ui.provectus.io/

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Navigate to menu item Kafka Connect
2. Create more than 1 connector if they do not exist yet
3. Observe the counter in the left upper corner of the right panel - Connects 1 (see attached screenshot)

**Expected behavior**
The value of connects counter equals the number of connectors.

**Screenshots**
![image](https://user-images.githubusercontent.com/92585878/145383968-cf0d94e8-835e-4d6b-9f6a-06acc959d027.png)


**Additional context**
(Add any other context about the problem here)
Wrong value for the counter present in both versions - old (https://www.kafka-ui.provectus.io/ui/clusters/local/connectors) and redesign (http://redesign.internal.kafka-ui.provectus.io/ui/clusters/local/connectors)

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Connect/List/List.tsx b/kafka-ui-react-app/src/components/Connect/List/List.tsx
index 5fa45a7c84a..65323914778 100644
--- a/kafka-ui-react-app/src/components/Connect/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Connect/List/List.tsx
@@ -24,7 +24,6 @@ export interface ListProps {
 
 const List: React.FC<ListProps> = ({
   connectors,
-  connects,
   areConnectsFetching,
   areConnectorsFetching,
   fetchConnects,
@@ -55,7 +54,7 @@ const List: React.FC<ListProps> = ({
           title="Connects"
           fetching={areConnectsFetching}
         >
-          {connects.length}
+          {connectors.length}
         </Indicator>
 
         <div className="column">


Test patch:
Repository: provectus/kafka-ui
Issue: Implement a workflow to bring up a temp demo external env
Labels: status/accepted
scope/infrastructure
type/feature

Implement a mechanism to bring up a separate public feature testing environment.
Purpose: demostrating that certain feature doesn't work to someone (e.g. an outside collaborator) without creating a VPN account for them.
1) Should be triggered in a PR by the label `status/feature_testing_public`.
2) Should be accessible without VPN but basic auth should be present.

Issue comments:
Done.

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/branch-deploy.yml b/.github/workflows/branch-deploy.yml
index b75bd5cfa50..996ba05da6e 100644
--- a/.github/workflows/branch-deploy.yml
+++ b/.github/workflows/branch-deploy.yml
@@ -1,20 +1,12 @@
 name: DeployFromBranch
 on:
   workflow_dispatch:
-    inputs:
-      public:
-          required: true
-          description: Will this environment be publicly available?
-          default: "no"
-      kafka-ui-password:
-        required: true
-        description: Password that will be used to login to branch env. If the env is not publicly accessible, this password will not be used.
-        default: ""
+
   pull_request:
     types: ['labeled']
 jobs:
   build:
-    if: ${{ github.event.label.name == 'status/feature_testing' }}
+    if: ${{ github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public' }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
@@ -92,14 +84,14 @@ jobs:
         run: |
           cd kafka-ui-infra/aws-infrastructure4eks/argocd/scripts
           echo "Branch:${{ needs.build.outputs.tag }}"
-          ./kafka-ui-deployment-from-branch.sh ${{ needs.build.outputs.tag }} ${{ github.event.inputs.public }} ${{ github.event.inputs.kafka-ui-password }}
+          ./kafka-ui-deployment-from-branch.sh ${{ needs.build.outputs.tag }} ${{ github.event.label.name }} ${{ secrets.FEATURE_TESTING_UI_PASSWORD }}
           git config --global user.email "kafka-ui-infra@provectus.com"
           git config --global user.name "kafka-ui-infra"
           git add ../kafka-ui-from-branch/
           git commit -m "added env:${{ needs.build.outputs.deploy }}" && git push || true
 
       - name: make comment with private deployment link
-        if: ${{ github.event.inputs.public == 'no' }}
+        if: ${{ github.event.label.name == 'status/feature_testing' }}
         uses: peter-evans/create-or-update-comment@v1.4.5
         with:
           issue-number: ${{ github.event.pull_request.number }}
@@ -107,7 +99,7 @@ jobs:
             Custom deployment will be available at http://${{ needs.build.outputs.tag }}.internal.kafka-ui.provectus.io
 
       - name: make comment with public deployment link
-        if: ${{ github.event.inputs.public == 'yes' }}
+        if: ${{ github.event.label.name == 'status/feature_testing_public' }}
         uses: peter-evans/create-or-update-comment@v1.4.5
         with:
           issue-number: ${{ github.event.pull_request.number }}


Test patch:
Repository: provectus/kafka-ui
Issue: Implement a workflow to bring up a temp demo external env
Labels: status/accepted
scope/infrastructure
type/feature

Implement a mechanism to bring up a separate public feature testing environment.
Purpose: demostrating that certain feature doesn't work to someone (e.g. an outside collaborator) without creating a VPN account for them.
1) Should be triggered in a PR by the label `status/feature_testing_public`.
2) Should be accessible without VPN but basic auth should be present.

Issue comments:
Done.

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/branch-remove.yml b/.github/workflows/branch-remove.yml
index cef13859e81..ad6e63aa71e 100644
--- a/.github/workflows/branch-remove.yml
+++ b/.github/workflows/branch-remove.yml
@@ -5,7 +5,7 @@ on:
     types: ['unlabeled']
 jobs:
   remove:
-    if: ${{ github.event.label.name == 'status/feature_testing' }}
+    if: ${{ github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public' }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2


Test patch:
Repository: provectus/kafka-ui
Issue: [Security] Workflow backend.yml is using vulnerable action Sibz/github-status-action
Labels: type/security
status/accepted
scope/infrastructure

The workflow backend.yml is referencing action Sibz/github-status-action using references v1. However this reference is missing the commit [650dd1a882a76dbbbc4576fb5974b8d22f29847f](https://github.com/Sibz/github-status-action/commits/650dd1a882a76dbbbc4576fb5974b8d22f29847f) which may contain fix to the some vulnerability. 
The vulnerability fix that is missing by actions version could be related to: 
(1) CVE fix 
(2) upgrade of vulnerable dependency 
(3) fix to secret leak and others. 
Please consider to update the reference to the action.

Issue comments:
Hello there fockboi-lgtm! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi, thanks for your concern. We'll get a look into this soon.

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/e2e-checks.yaml b/.github/workflows/e2e-checks.yaml
index 11072bfca8d..b6c44e72e1b 100644
--- a/.github/workflows/e2e-checks.yaml
+++ b/.github/workflows/e2e-checks.yaml
@@ -64,7 +64,7 @@ jobs:
           destination_dir: ./allure
       - name: Post the link to allure report
         if: always()
-        uses: Sibz/github-status-action@v1
+        uses: Sibz/github-status-action@v1.1.6
         with:
           authToken: ${{secrets.GITHUB_TOKEN}}
           context: 'Test report'
@@ -73,4 +73,4 @@ jobs:
           target_url: https://${{ github.repository_owner }}.github.io/kafka-ui/allure/allure-results/${{ github.run_number }}
       - name: Dump docker logs on failure
         if: failure()
-        uses: jwalton/gh-docker-logs@v2.0.2
\ No newline at end of file
+        uses: jwalton/gh-docker-logs@v2.0.2


Test patch:
Repository: provectus/kafka-ui
Issue: Snappy support missing
Labels: type/bug
scope/backend
status/accepted

Hi guys,

My avro data in kafka is compressed with Snappy. Kafka-ui prints this stacktrace when I load messages:

```txt
java.lang.NoClassDefFoundError: Could not initialize class org.xerial.snappy.Snappy
	at org.xerial.snappy.SnappyInputStream.hasNextChunk(SnappyInputStream.java:435)
	at org.xerial.snappy.SnappyInputStream.read(SnappyInputStream.java:466)
	at java.base/java.io.DataInputStream.readByte(DataInputStream.java:270)
```
I fixed this locally by adding

```xml
        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <version>1.1.7.3</version>
        </dependency>
```

Which gave me something like:
```txt
java.lang.UnsatisfiedLinkError: /tmp/snappy-1.1.7-5cec5405-2ce7-4046-a8bd-922ce96534a0-libsnappyjava.so: 
Error loading shared library ld-linux-x86-64.so.2: No such file or directory
```

Which I solved by adding `gcompat` to the `apk add` command.

Would be awesome to have this added to this amazing project.


Issue comments:
Hello there JoeryH! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi 👋 
Hi Joery, 
thanks for your interest in kafka-ui. And thank you for the solution! 
We’re having a long holidays streak here, so we’ll get back to this issue somewhere around 10th of January. 
Happy holidays!

> On 31 Dec 2021, at 17:09, Joery ***@***.***> wrote:
> 
> ﻿
> Hi 👋
> 
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android. 
> You are receiving this because you are subscribed to this thread.

Hi @JoeryH, we fixed this bug in current master - you can use docker image with "master" tag (sha256:5c1346c11a876af0d25bd2871409631b01a0d7d15c0ef22c40db16390aa1f919) 
hey, the latest version works for me! Thank you for the quick fix!
@JoeryH glad it works! 

Pull request review comments:
What about maven dependencies mentioned in the issue?
@Haarolean nothing connected with them - all of them already included in kafka-client lib. We just need to add missing os libs. I checked topic all compressions with this change - all work fine
Great, thanks!

Patch that resolved the issue:
diff --git a/kafka-ui-api/Dockerfile b/kafka-ui-api/Dockerfile
index 2bc496b1f1b..81cc6c9a549 100644
--- a/kafka-ui-api/Dockerfile
+++ b/kafka-ui-api/Dockerfile
@@ -1,5 +1,5 @@
-FROM alpine:latest
-RUN apk add openjdk13-jre
+FROM alpine:3.15.0
+RUN apk add --no-cache openjdk13-jre libc6-compat gcompat
 VOLUME /tmp
 ARG JAR_FILE
 COPY "/target/${JAR_FILE}" "/kafka-ui-api.jar"


Test patch:
Repository: provectus/kafka-ui
Issue: Support for ingressClassName in helm chart
Labels: type/enhancement
scope/k8s

Currently the helm chart doesn't support specifying ingressClassName in the ingress object.
Need to support it.

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/charts/kafka-ui/templates/ingress.yaml b/charts/kafka-ui/templates/ingress.yaml
index 6c823c0ab05..641cfd9b67e 100644
--- a/charts/kafka-ui/templates/ingress.yaml
+++ b/charts/kafka-ui/templates/ingress.yaml
@@ -24,6 +24,9 @@ spec:
         - {{ .Values.ingress.host }}
       secretName: {{ .Values.ingress.tls.secretName }}
   {{- end }}
+  {{- if .Values.ingress.ingressClassName }}
+  ingressClassName: {{ .Values.ingress.ingressClassName }}
+  {{- end }}
   rules:
     - http:
         paths:
diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml
index 50e54038500..3fc0754aff5 100644
--- a/charts/kafka-ui/values.yaml
+++ b/charts/kafka-ui/values.yaml
@@ -75,6 +75,9 @@ ingress:
   # Annotations for the Ingress
   annotations: {}
 
+  # ingressClassName for the Ingress
+  ingressClassName: ""
+
   # The path for the Ingress
   path: ""
 


Test patch:
Repository: provectus/kafka-ui
Issue: Bad handling of cluster names
Labels: type/bug
good first issue
scope/backend
status/accepted

**Describe the bug**

We have switched to using user-friendly cluster names in `KAFKA_CLUSTERS_NNN_NAME`. Such that those names are human readable with spaces. After we changed to those names, no operations can be done on cluster (can still browse around tho).


**Set up**
Docker latest master tag


**Steps to Reproduce**
Steps to reproduce the behavior:

1. Use user friendly names such as `KAFKA_CLUSTERS_0_NAME: "Cluster name"`

**Expected behavior**
Everything works as expected.

**Actual behavior**
Error message in UI (i truncated screenshot to not expose private information):

![Screenshot from 2021-11-30 10-47-38](https://user-images.githubusercontent.com/985805/143977249-9b15b597-ccf1-4b8e-a4ba-86cc90354f28.png)

And errors in the logs:

```
02:47:19.596 [parallel-3] WARN  com.provectus.kafka.ui.exception.ErrorCode - Multiple class com.provectus.kafka.ui.exception.ErrorCode values refer to code 4001
02:47:19.614 [parallel-3] DEBUG org.springframework.http.codec.json.Jackson2JsonEncoder - [1296e0bd-3] Encoding [class ErrorResponseDTO {<LF>    code: 4007<LF>    message: No cluster for name 'Cluster%20name'<LF>    timestam (truncated)...]
0
```

Meantime browsing all topics, data etc works just fine.




Issue comments:
Confirmed that replacing spaces in names with underscores "resolves" this issue.

I think this either need to be documented or fixed by using URL encoding everywhere. Or using original name for display and replacing all non-supported characters with underscore for URLs.
Hmm, that's pretty unnatural to put spaces there since these are just environment variables.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
index b998748fccb..41b6cc408f5 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/ReadOnlyModeFilter.java
@@ -3,6 +3,8 @@
 import com.provectus.kafka.ui.exception.ClusterNotFoundException;
 import com.provectus.kafka.ui.exception.ReadOnlyModeException;
 import com.provectus.kafka.ui.service.ClustersStorage;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 import java.util.regex.Pattern;
 import lombok.RequiredArgsConstructor;
 import org.jetbrains.annotations.NotNull;
@@ -32,7 +34,8 @@ public Mono<Void> filter(ServerWebExchange exchange, @NotNull WebFilterChain cha
     }
 
     var path = exchange.getRequest().getPath().pathWithinApplication().value();
-    var matcher = CLUSTER_NAME_REGEX.matcher(path);
+    var decodedPath = URLDecoder.decode(path, StandardCharsets.UTF_8);
+    var matcher = CLUSTER_NAME_REGEX.matcher(decodedPath);
     if (!matcher.find()) {
       return chain.filter(exchange);
     }


Test patch:
Repository: provectus/kafka-ui
Issue: add workflow that tests helm chart
Labels: type/enhancement
status/accepted
scope/infrastructure
scope/k8s

Subj.

Issue comments:
k8s versions:
1.17.0
1.18.0
1.19.0
1.20.0
1.21.0
1.22.0+

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
new file mode 100644
index 00000000000..69d25985e5b
--- /dev/null
+++ b/.github/workflows/helm.yaml
@@ -0,0 +1,27 @@
+name: Helm
+on:
+  pull_request:
+    types: [ 'opened', 'edited', 'reopened', 'synchronize' ]
+    paths:
+      - "charts/**"
+jobs:
+  build-and-test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Helm tool installer
+        uses: Azure/setup-helm@v1
+      - name: Setup Kubeval
+        uses: lra/setup-kubeval@v1.0.1
+      - name: Run kubeval
+        shell: bash
+        run: |
+          sed -i "s@enabled: false@enabled: true@g" charts/kafka-ui/values.yaml
+          K8S_VERSIONS=$(git ls-remote --refs --tags https://github.com/kubernetes/kubernetes.git | cut -d/ -f3 | grep -e '^v1\.[0-9]\{2\}\.[0]\{1,2\}$' | grep -v -e  '^v1\.1[0-8]\{1\}' | cut -c2-)
+          echo "NEXT K8S VERSIONS ARE GOING TO BE TESTED: $K8S_VERSIONS"
+          echo ""
+          for version in $K8S_VERSIONS
+            do 
+              echo $version;
+              helm template charts/kafka-ui -f charts/kafka-ui/values.yaml | kubeval --additional-schema-locations https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master --strict -v $version;
+            done


Test patch:
Repository: provectus/kafka-ui
Issue: Readonly mode regression
Labels: type/bug
scope/backend
status/accepted
type/regression

### Discussed in https://github.com/provectus/kafka-ui/discussions/1497

<div type='discussions-op-text'>

<sup>Originally posted by **giom-l** January 26, 2022</sup>
Hi, 

Long time no see. I just realized I had missed some releases since last time.
So I just tried to update our UI from 0.2.1 to 0.3.3. 
What a change ^^.

However, I have some concerns about one of the most useful feature to me : the read-only mode.
This was working perfectly in 0.2.1 and I'm little lost in 0.3.3 (
- no more "read only" label anywhere (I saw it was brought back in 0.3.2, but didn't find it)
- Also, all creation/deletion options are still visible but are just not working : 
      - sometimes with an error on the UI
      - sometimes without anything (I only get HTTP405 error)

From a user experience perspective, it is a huge regression (IMO, obviously)
As a user, I really prefer not to see unavailable options than having obscure error messages, like the following we have when trying to create a topic : 
![image](https://user-images.githubusercontent.com/29728596/151240631-463acb14-a0be-46f4-8c6f-162ba72dda33.png)

Is this behavior intended or the "UI_hide_all_readonly_incompatible_components" behavior could be back anytime soon ? 

For now, I can't make the switch without having lots of questions like "wait, whaaaaat, we can modify clusters now ?" or "wait, whaaat, I'm trying to create topics but can't understand why it is not working" and I'll stick with 0.2.1 :-/</div>

Issue comments:
@giom-l thanks for the feedback, glad you like the update :)
As I mentioned in a discussion, this seems to be a regression indeed. We'll take a look!
@giom-l the fix is available in `master`-labeled image
Sorry for the delay, I just tested it and it's OK :)
> Sorry for the delay, I just tested it and it's OK :)

glad it works! so you're on 0.3 now?

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
index 53196708042..8626047c4c5 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/InternalClusterState.java
@@ -28,6 +28,7 @@ public class InternalClusterState {
   private List<Feature> features;
   private BigDecimal bytesInPerSec;
   private BigDecimal bytesOutPerSec;
+  private Boolean readOnly;
 
   public InternalClusterState(KafkaCluster cluster, MetricsCache.Metrics metrics) {
     name = cluster.getName();
@@ -66,6 +67,7 @@ public InternalClusterState(KafkaCluster cluster, MetricsCache.Metrics metrics)
     inSyncReplicasCount = partitionsStats.getInSyncReplicasCount();
     outOfSyncReplicasCount = partitionsStats.getOutOfSyncReplicasCount();
     underReplicatedPartitionCount = partitionsStats.getUnderReplicatedPartitionCount();
+    readOnly = cluster.getReadOnly();
   }
 
 }


Test patch:
Repository: provectus/kafka-ui
Issue: add workflow that tests helm chart
Labels: type/enhancement
status/accepted
scope/infrastructure
scope/k8s

Subj.

Issue comments:
k8s versions:
1.17.0
1.18.0
1.19.0
1.20.0
1.21.0
1.22.0+

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml
index 69d25985e5b..18abec82f01 100644
--- a/.github/workflows/helm.yaml
+++ b/.github/workflows/helm.yaml
@@ -4,6 +4,11 @@ on:
     types: [ 'opened', 'edited', 'reopened', 'synchronize' ]
     paths:
       - "charts/**"
+
+  schedule:
+    # * is a special character in YAML so you have to quote this string
+    - cron:  '0 8 * * 3'
+
 jobs:
   build-and-test:
     runs-on: ubuntu-latest


Test patch: