You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Yunyung (via GitHub)" <gi...@apache.org> on 2024/11/30 06:39:30 UTC

[PR] KAFKA-18118: Fix the incorrect soft link of results/latest [kafka]

Yunyung opened a new pull request, #17992:
URL: https://github.com/apache/kafka/pull/17992

   Correct the link after running e2e tests using docker.
   
   Before:
   ![Screenshot from 2024-11-30 14-38-41](https://github.com/user-attachments/assets/2c26ed98-943d-41e9-ba95-a6f7c6dbec54)
   
   
   After:
   ![Screenshot from 2024-11-30 14-35-31](https://github.com/user-attachments/assets/3679f66e-bddc-46f2-9067-f17611e429af)
   ![Screenshot from 2024-11-30 14-36-13](https://github.com/user-attachments/assets/e071735f-19a5-4629-99ed-c5ab9ffa6a9e)
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18118: Fix the incorrect soft link of results/latest [kafka]

Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on code in PR #17992:
URL: https://github.com/apache/kafka/pull/17992#discussion_r1864122240


##########
tests/docker/ducker-ak:
##########
@@ -529,7 +544,10 @@ ducker_test() {
 
     cmd="cd /opt/kafka-dev && ${ducktape_cmd} --cluster-file /opt/kafka-dev/tests/docker/build/cluster.json $test_names $ducktape_args"
     echo "docker exec ducker01 bash -c \"${cmd}\""
-    exec docker exec --user=ducker ducker01 bash -c "${cmd}"
+    docker exec --user=ducker ducker01 bash -c "${cmd}"

Review Comment:
   The symbolic link 'latest' is created in this e2e, after all the tests are completed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18118: Fix the incorrect soft link of results/latest [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17992:
URL: https://github.com/apache/kafka/pull/17992#discussion_r1866426354


##########
tests/docker/ducker-ak:
##########
@@ -489,6 +489,21 @@ EOF
     exec 3>&-
 }
 
+correct_latest_link() {
+    local result_dir="${kafka_dir}/results"
+    local latest_link="${result_dir}/latest"
+    local latest_test_dirname=""
+    local latest_test_dir=""
+
+    # Correct the link if it's a symbolic link and broken.
+    if [[ -L "${latest_link}" ]] && [[ ! -e "${latest_link}" ]]; then
+        latest_test_dirname=$(basename "$(readlink "${latest_link}")")
+        latest_test_dir="${result_dir}/${latest_test_dirname}"
+        unlink "${latest_link}"
+        ln -s "${latest_test_dir}" "${latest_link}"

Review Comment:
   we can just replace `${latest_test_dir}"` by `"${result_dir}/${latest_test_dirname}"`



##########
tests/docker/ducker-ak:
##########
@@ -489,6 +489,21 @@ EOF
     exec 3>&-
 }
 
+correct_latest_link() {
+    local result_dir="${kafka_dir}/results"
+    local latest_link="${result_dir}/latest"
+    local latest_test_dirname=""
+    local latest_test_dir=""
+
+    # Correct the link if it's a symbolic link and broken.
+    if [[ -L "${latest_link}" ]] && [[ ! -e "${latest_link}" ]]; then
+        latest_test_dirname=$(basename "$(readlink "${latest_link}")")

Review Comment:
   Maybe we can declare the local variable when we need?
   ```
   local latest_test_dirname=$(basename "$(readlink "${latest_link}")")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18118: Fix the incorrect soft link of results/latest [kafka]

Posted by "Yunyung (via GitHub)" <gi...@apache.org>.
Yunyung commented on PR #17992:
URL: https://github.com/apache/kafka/pull/17992#issuecomment-2513398494

   Thanks for the review! Update, and then test the process mentioned above again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18118: Fix the incorrect soft link of results/latest [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #17992:
URL: https://github.com/apache/kafka/pull/17992


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org