feedback-to-code/mozzarella huggingface dataset:
Repository: provectus/kafka-ui
Issue: Add an ability to sort topic list by replication factor
Labels: type/enhancement
scope/backend

### Is your proposal related to a problem?
No

### Describe the solution you'd like
Add an ability to sort topic list by replication factor

### Additional context

UI will be updated in context of https://github.com/provectus/kafka-ui/issues/608

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
index c68c5900ca3..11217e0a919 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/ClusterService.java
@@ -142,6 +142,8 @@ private Comparator<InternalTopic> getComparatorForTopic(Optional<TopicColumnsToS
         return Comparator.comparing(InternalTopic::getPartitionCount);
       case OUT_OF_SYNC_REPLICAS:
         return Comparator.comparing(t -> t.getReplicas() - t.getInSyncReplicas());
+      case REPLICATION_FACTOR:
+        return Comparator.comparing(InternalTopic::getReplicationFactor);
       case NAME:
       default:
         return defaultComparator;
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index 9c75c110da4..25d4fb89604 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -1457,6 +1457,7 @@ components:
         - NAME
         - OUT_OF_SYNC_REPLICAS
         - TOTAL_PARTITIONS
+        - REPLICATION_FACTOR
 
     Topic:
       type: object


Test patch:
Repository: provectus/kafka-ui
Issue: Update favicon
Labels: type/enhancement
scope/frontend

List of original logos - http://svn.apache.org/repos/asf/kafka/site/logos/

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml
index 88944ca6f97..48b47c5196f 100644
--- a/.github/workflows/pr-checks.yaml
+++ b/.github/workflows/pr-checks.yaml
@@ -10,6 +10,6 @@ jobs:
       - uses: kentaro-m/task-completed-checker-action@v0.1.0
         with:
           repo-token: "${{ secrets.GITHUB_TOKEN }}"
-      - uses: dekinderfiets/pr-description-enforcer@v0.0.1
+      - uses: dekinderfiets/pr-description-enforcer@0.0.1
         with:
           repo-token: '${{ secrets.GITHUB_TOKEN }}'


Test patch:
Repository: provectus/kafka-ui
Issue: Provide cleanup policy in topic list
Labels: type/enhancement
good first issue
scope/backend
scope/frontend

### Describe the solution you'd like

Backend should expose cleanup policy in topic list request:
delete (with retention), compact, compact with delete (with retention)
Frontend should display this info in topic list page


Issue comments:
Waiting frontend
Looks like @GneyHabub added cleanup policy to topic description, but missed topic list part. FYI: @workshur 

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
index 34f45dbea92..93c7f55baac 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx
@@ -30,6 +30,7 @@ const Overview: React.FC<Props> = ({
   segmentCount,
   clusterName,
   topicName,
+  cleanUpPolicy,
   clearTopicMessages,
 }) => {
   const { isReadOnly } = React.useContext(ClusterContext);
@@ -59,6 +60,9 @@ const Overview: React.FC<Props> = ({
           <BytesFormatted value={segmentSize} />
         </Indicator>
         <Indicator label="Segment count">{segmentCount}</Indicator>
+        <Indicator label="Clean Up Policy">
+          <span className="tag is-info">{cleanUpPolicy || 'Unknown'}</span>
+        </Indicator>
       </MetricsWrapper>
       <div className="box">
         <table className="table is-striped is-fullwidth">


Test patch:
Repository: provectus/kafka-ui
Issue: [helm] restart application when configmap or secret changes
Labels: type/enhancement

### Is your proposal related to a problem?

In my opinion would be great if the deployment was automatically restarted when the configmap or secret changes.

### Describe the solution you'd like

Something like this should be enough
```yaml
kind: Deployment
spec:
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
```

Let me know what are your thoughts, I can deal with a PR

Issue comments:
Hi, @FedeBev. Thanks for creating issue. As for me looks interesting. @RustamGimadiev what is your opinion on this? Btw any PR is more then welcome )

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 f8bfe02ae6b..21091c4ad3d 100644
--- a/charts/kafka-ui/templates/deployment.yaml
+++ b/charts/kafka-ui/templates/deployment.yaml
@@ -13,10 +13,12 @@ spec:
       {{- include "kafka-ui.selectorLabels" . | nindent 6 }}
   template:
     metadata:
-    {{- with .Values.podAnnotations }}
       annotations:
-        {{- toYaml . | nindent 8 }}
-    {{- end }}
+      {{- with .Values.podAnnotations }}
+          {{- toYaml . | nindent 8 }}
+      {{- end }}
+        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
+        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
       labels:
         {{- include "kafka-ui.selectorLabels" . | nindent 8 }}
     spec:


Test patch:
Repository: provectus/kafka-ui
Issue: Created connector in the local cluster is duplicated to the secondLocal cluster 
Labels: type/bug

**Describe the bug**

When I create a connector in the Local cluster I also see this connector in the Second cluster. It works in both ways.

**Set up**

`./mvnw clean install -Pprod`
`docker-compose -f ./docker/kafka-ui-connectors.yaml up`

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Go to the Local cluster
2. Create a topic with a message
3. Create a connector
4. Go to the Second Local cluster 

**Expected behavior**
Created connector only in the Local cluster

**Screenshots**

https://user-images.githubusercontent.com/44370201/131527173-ba87e34a-f04c-457e-8780-ed2b02287711.mov


**Additional context**
Connector's config: 
``` 
{
  "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",    
  "connection.url": "jdbc:postgresql://postgres-db:5432/test",     
  "connection.user": "dev_user",   
  "connection.password": "12345",
  "topics": "TEST_TOPIC",
  "table.name.format": "sink_activities_e2e_check",
  "key.converter": "org.apache.kafka.connect.storage.StringConverter",
  "key.converter.schema.registry.url": "http://schemaregistry0:8085",
  "value.converter": "org.apache.kafka.connect.json.JsonConverter",
  "value.converter.schema.registry.url": "http://schemaregistry0:8085",
  "auto.create": "true",
  "pk.mode": "record_value",
  "pk.fields": "id",
  "insert.mode": "upsert",
  "errors.log.enable": "true",
  "errors.log.include.messages": "true"
}
```

Issue comments:
Thanks, @antipova926 for finding this issue.
We realized that there is a misconfiguration on kafka-ui's docker-compose side. I'll fix it asap.
Let me assign myself this ticket and resolve the issue

Pull request review comments:

Patch that resolved the issue:
diff --git a/docker/kafka-ui-connectors.yaml b/docker/kafka-ui-connectors.yaml
index 54cd1d3ddaf..57137cef6b0 100644
--- a/docker/kafka-ui-connectors.yaml
+++ b/docker/kafka-ui-connectors.yaml
@@ -27,8 +27,6 @@ services:
       KAFKA_CLUSTERS_1_ZOOKEEPER: zookeeper1:2181
       KAFKA_CLUSTERS_1_JMXPORT: 9998
       KAFKA_CLUSTERS_1_SCHEMAREGISTRY: http://schemaregistry1:8085
-      KAFKA_CLUSTERS_1_KAFKACONNECT_0_NAME: first
-      KAFKA_CLUSTERS_1_KAFKACONNECT_0_ADDRESS: http://kafka-connect0:8083
 
   zookeeper0:
     image: confluentinc/cp-zookeeper:5.2.4


Test patch:
Repository: provectus/kafka-ui
Issue: Connector doesn't show trace when failed
Labels: type/bug
scope/backend
scope/frontend

**Describe the bug**

Kafka Connector doesn't show stack trace when they fail to run.

**Set up**

1. Create a new connector (I used Debezium)
2. Config the connector with the wrong password.

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Click `Kafka Connector` in the side bar.
2. Click on a connector.

**Expected behavior**

`Trace` column show the stack trace of the failure.

**Screenshots**

![image](https://user-images.githubusercontent.com/42168740/129319307-5cf3acad-f895-41e7-ad15-196887d55c79.png)

**Additional context**
(Add any other context about the problem here)

Issue comments:
Hi, @tuananhlai. Thanks for creating this issue. Will try to add it in next version

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-connect-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-connect-api.yaml
index a5b8f18a243..14c996ee545 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-connect-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-connect-api.yaml
@@ -409,6 +409,8 @@ components:
             - UNASSIGNED
         worker_id:
           type: string
+        trace:
+          type: string
 
     ConnectorStatus:
       type: object
@@ -427,6 +429,8 @@ components:
                 - UNASSIGNED
             worker_id:
               type: string
+            trace:
+              type: string
         tasks:
           type: array
           items:


Test patch:
Repository: provectus/kafka-ui
Issue: Support delete,compact topics
Labels: type/bug

**Describe the bug**

If topic config is delete,compact  topic list request is failing


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/CleanupPolicy.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/CleanupPolicy.java
index bfbfdf9d81a..6e75c3edecb 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/CleanupPolicy.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/model/CleanupPolicy.java
@@ -2,27 +2,37 @@
 
 import com.provectus.kafka.ui.exception.IllegalEntityStateException;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
 public enum CleanupPolicy {
   DELETE("delete"),
   COMPACT("compact"),
-  COMPACT_DELETE("compact,delete"),
+  COMPACT_DELETE(Arrays.asList("compact,delete", "delete,compact")),
   UNKNOWN("unknown");
 
-  private final String cleanUpPolicy;
+  private final List<String> cleanUpPolicy;
 
   CleanupPolicy(String cleanUpPolicy) {
+    this(Collections.singletonList(cleanUpPolicy));
+  }
+
+  CleanupPolicy(List<String> cleanUpPolicy) {
     this.cleanUpPolicy = cleanUpPolicy;
   }
 
   public String getCleanUpPolicy() {
-    return cleanUpPolicy;
+    return cleanUpPolicy.get(0);
   }
 
   public static CleanupPolicy fromString(String string) {
     return Arrays.stream(CleanupPolicy.values())
-        .filter(v -> v.cleanUpPolicy.equals(string.replace(" ", "")))
-        .findFirst()
+        .filter(v ->
+            v.cleanUpPolicy.stream().anyMatch(
+                s -> s.equals(string.replace(" ", "")
+                )
+            )
+        ).findFirst()
         .orElseThrow(() ->
             new IllegalEntityStateException("Unknown cleanup policy value: " + string));
   }


Test patch:
Repository: provectus/kafka-ui
Issue: Topic search issue (when pagination enabled)
Labels: type/bug
scope/frontend
status/accepted

**Describe the bug**

Go to Topics -> select page 2 -> insert any topic name in search string (to filter only 1 topic) -> table will be empty.
This is because after search we still passing page=2 query param -> we need to set 'page' query param to 1 after search criteria edit

**Set up**
(How do you run the app?)


**Steps to Reproduce**
Steps to reproduce the behavior:

see desc

**Expected behavior**
(A clear and concise description of what you expected to happen)

**Screenshots**
(If applicable, add screenshots to help explain your problem)


**Additional context**
(Add any other context about the problem here
<img width="768" alt="Screenshot 2021-10-31 at 17 38 00" src="https://user-images.githubusercontent.com/702205/139588763-9d41e6b1-70ef-4d6b-a58c-809c75bd8884.png">
)


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx
index 4ba1c0e8160..4fcd0285fb1 100644
--- a/kafka-ui-react-app/src/components/Topics/List/List.tsx
+++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx
@@ -121,6 +121,13 @@ const List: React.FC<TopicsListProps> = ({
     closeConfirmationModal();
     clearSelectedTopics();
   }, [clusterName, selectedTopics]);
+  const searchHandler = React.useCallback(
+    (searchString: string) => {
+      setTopicsSearch(searchString);
+      history.push(`${pathname}?page=1&perPage=${perPage || PER_PAGE}`);
+    },
+    [search, pathname, perPage]
+  );
 
   return (
     <div className="section">
@@ -142,7 +149,7 @@ const List: React.FC<TopicsListProps> = ({
           </div>
           <div className="column">
             <Search
-              handleSearch={setTopicsSearch}
+              handleSearch={searchHandler}
               placeholder="Search by Topic Name"
               value={search}
             />
diff --git a/kafka-ui-react-app/src/components/Topics/List/__tests__/__snapshots__/List.spec.tsx.snap b/kafka-ui-react-app/src/components/Topics/List/__tests__/__snapshots__/List.spec.tsx.snap
index 59f2f1930e3..d2bb3c690a2 100644
--- a/kafka-ui-react-app/src/components/Topics/List/__tests__/__snapshots__/List.spec.tsx.snap
+++ b/kafka-ui-react-app/src/components/Topics/List/__tests__/__snapshots__/List.spec.tsx.snap
@@ -111,7 +111,7 @@ exports[`List when it does not have readonly flag matches the snapshot 1`] = `
               className="column"
             >
               <Search
-                handleSearch={[MockFunction]}
+                handleSearch={[Function]}
                 placeholder="Search by Topic Name"
                 value=""
               >


Test patch:
Repository: provectus/kafka-ui
Issue: Request to add a github action to the repo
Labels: type/enhancement
status/accepted
scope/infrastructure

### Is your proposal related to a problem?

<!--
  Provide a clear and concise description of what the problem is.
  For example, "I'm always frustrated when..."
-->

(Write your answer here.)
No, rather related  to adding a new feature

### Describe the solution you'd like

<!--
  Provide a clear and concise description of what you want to happen.
-->

(Describe your proposed solution here.)
I see that the repo is quite engaging
I would love to see a github - action welcoming all the new contributors on their issues and Prs

If you love the idea , assign me

### Describe alternatives you've considered

<!--
  Let us know about other solutions you've tried or researched.
-->

(Write your answer here.)

### Additional context

<!--
  Is there anything else you can add about the proposal?
  You might want to link to related issues here, if you haven't already.
-->

(Write your answer here.)

If you love the idea , assign me


Issue comments:
Hey, sounds like a great idea. Would be nice to see that!

Pull request review comments:

Patch that resolved the issue:
diff --git a/.github/workflows/welcome-first-time-contributors.yml b/.github/workflows/welcome-first-time-contributors.yml
new file mode 100644
index 00000000000..f0caa2053e1
--- /dev/null
+++ b/.github/workflows/welcome-first-time-contributors.yml
@@ -0,0 +1,30 @@
+name: Welcome first time contributors
+
+on:
+  pull_request_target:
+    types:
+      - opened
+  issues:
+    types:
+      - opened
+
+jobs:
+  welcome:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/first-interaction@v1
+        with:
+          repo-token: ${{ secrets.GITHUB_TOKEN }}
+          issue-message: |
+            Hello there ${{ github.actor }}! 👋
+
+            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. 👀
+            
+          pr-message: |
+            Hello there ${{ github.actor }}! 👋
+
+            Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖
+
+            We will try to review it soon!


Test patch:
Repository: provectus/kafka-ui
Issue: Calculation error in Time to retain data [topic creation]
Labels: type/bug
scope/frontend
status/accepted

**Describe the bug**
(A clear and concise description of what the bug is.)
Time to retain data tab displays 168d when 4w is selected; 28d should be selected; calculation error in ms (s vs ms)

**Set up**
(How do you run the app?)
docker-compose -f ./docker/kafka-ui.yaml up

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Topics
2. Add a Topic
3. Navigate to Time to retain data
4. Select 4w
5. 168d (supposedly 14515200000ms) is displayed

**Expected behavior**
(A clear and concise description of what you expected to happen)
28d (2.419e+9ms) should be displayed when 4w is selected

**Screenshots**
(If applicable, add screenshots to help explain your problem)


**Additional context**
(Add any other context about the problem here)


Issue comments:
Hey, thanks for reaching out. We'll get a look at this.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
index afd974b151b..17221bf8e7c 100644
--- a/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
+++ b/kafka-ui-react-app/src/components/Topics/shared/Form/TimeToRetainBtns.tsx
@@ -29,7 +29,7 @@ const TimeToRetainBtns: React.FC<Props> = ({ name }) => (
     <TimeToRetainBtn
       text="4w"
       inputName={name}
-      value={MILLISECONDS_IN_DAY * 7 * 24}
+      value={MILLISECONDS_IN_DAY * 7 * 4}
     />
   </div>
 );


Test patch:
Repository: provectus/kafka-ui
Issue: bump apache-commons-compress from 1.19 to 1.21 in kafka-ui-api
Labels: scope/backend
type/security
status/accepted

Current version in use is almost two years old.

https://mvnrepository.com/artifact/org.apache.commons/commons-compress

Issue comments:
Hi,

there's nothing wrong with using older versions of dependencies (implying there are no known security vulnerabilities, which is true for 1.19). On the other hand, bumping dependency version may require additional testing overhead, because sometimes even minor bumps can cause some bugs/problems/instabilities.
Considering these facts, I'm closing this since there's no need in bumping this dependency so far.
Discussed in #1083, that's a transitive dependency.

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index 44ee572a213..cb5bf344660 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
         <openapi-generator-maven-plugin.version>4.3.0</openapi-generator-maven-plugin.version>
         <swagger-annotations.version>1.6.0</swagger-annotations.version>
         <springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
-        <avro.version>1.9.2</avro.version>
+        <avro.version>1.11.0</avro.version>
         <confluent.version>5.5.1</confluent.version>
         <apache.commons.version>2.2</apache.commons.version>
         <test.containers.version>1.16.2</test.containers.version>


Test patch:
Repository: provectus/kafka-ui
Issue: Topic disk usage size is incorrect in topic details view
Labels: type/bug
scope/backend
scope/frontend
status/accepted
status/confirmed

**Describe the bug**
If topic size > int.max, topic details page will display "-bytes". This is happening because field segmentSize is int for topicdetails object.



Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
index cb882ef078a..d7c1fe30824 100644
--- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
+++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml
@@ -1707,6 +1707,7 @@ components:
           type: number
         segmentSize:
           type: integer
+          format: int64
         segmentCount:
           type: integer
         underReplicatedPartitions:


Test patch:
Repository: provectus/kafka-ui
Issue: bump jackson-databind from 2.10.2 to 2.13.0 in the kafka-ui-api
Labels: scope/backend
type/security
status/accepted

Request review and update the bump jackson-databind from 2.10.2 to latest supported version.

Latest versions may be found here:
https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind

jackson-databind 2.10.2 is vulnerable to the following CVEs:
https://nvd.nist.gov/vuln/detail/CVE-2020-25649

Vulnerabilities identified using Prisma Twistlock Scans against the kafka-ui-api-0.2.1.jar file conducted on 10 November 2021.

Jar file was extracted and files were located here:  \kafka-ui-api-0.2.1\BOOT-INF\lib\

note: This jar also contains 1.3.61 versions for these related files which may also need updating: jackson-annotations, jackson-core, jackson-dataformat-cbor, jackson-datatype-guava, jackson-datatype-jdk8, jackson-datatype-joda,jackson-datatype-jsr310 and jackson-module-parameter-names

Issue comments:
This one is tricky (https://github.com/OpenAPITools/jackson-databind-nullable/issues/25). Will fix a bit later.

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index cb5bf344660..a410b6bff07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
         <spring-boot.version>2.5.6</spring-boot.version>
-        <jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
+        <jackson-databind-nullable.version>0.2.2</jackson-databind-nullable.version>
         <org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
         <org.projectlombok.version>1.18.20</org.projectlombok.version>
         <org.projectlombok.e2e-checks.version>1.18.20</org.projectlombok.e2e-checks.version>


Test patch: