codeant-ai-for-open-source[bot] commented on code in PR #40556:
URL: https://github.com/apache/superset/pull/40556#discussion_r3328330022


##########
.github/workflows/ephemeral-env.yml:
##########
@@ -319,12 +321,16 @@ jobs:
           INPUT_ISSUE_NUMBER: ${{ github.event.inputs.issue_number || 
github.event.pull_request.number }}
       - name: Get network interface
         id: get-eni
+        env:
+          TASK_ARN: ${{ steps.list-tasks.outputs.task }}
         run: |
-          echo "eni=$(aws ecs describe-tasks --cluster superset-ci --tasks ${{ 
steps.list-tasks.outputs.task }} | jq '.tasks[0].attachments[0].details | 
map(select(.name=="networkInterfaceId"))[0].value')" >> $GITHUB_OUTPUT
+          echo "eni=$(aws ecs describe-tasks --cluster superset-ci --tasks 
"$TASK_ARN" | jq '.tasks[0].attachments[0].details | 
map(select(.name=="networkInterfaceId"))[0].value')" >> $GITHUB_OUTPUT
       - name: Get public IP
         id: get-ip
+        env:
+          ENI_ID: ${{ steps.get-eni.outputs.eni }}
         run: |
-          echo "ip=$(aws ec2 describe-network-interfaces 
--network-interface-ids ${{ steps.get-eni.outputs.eni }} | jq -r 
'.NetworkInterfaces | first | .Association.PublicIp')" >> $GITHUB_OUTPUT
+          echo "ip=$(aws ec2 describe-network-interfaces 
--network-interface-ids "$ENI_ID" | jq -r '.NetworkInterfaces | first | 
.Association.PublicIp')" >> $GITHUB_OUTPUT

Review Comment:
   **🔴 Architect Review — CRITICAL**
   
   This change assumes step outputs can be moved into env vars without changing 
their shape, but `steps.list-tasks.outputs.task` and 
`steps.get-eni.outputs.eni` are produced via `jq` (without `-r`) and therefore 
include JSON quotes; when passed through `$TASK_ARN` / `$ENI_ID`, those quotes 
become literal characters and can break the AWS CLI calls in the normal 
ephemeral-env-up path.
   
   **Suggestion:** Normalize these outputs at their source (emit raw values 
with `jq -r`) or explicitly dequote before reuse, so the contract for 
cross-step values is stable whether consumed inline or via `env`, preserving 
behavior while keeping the hardening goal.
   
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e6cd533839134456a735623858b8c9df&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 | [Fix in VSCode 
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e6cd533839134456a735623858b8c9df&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is an **Architect / Logical Review** comment left during a code review. 
These reviews are first-class, important findings — not optional suggestions. 
Do NOT dismiss this as a 'big architectural change' just because the title says 
architect review; most of these can be resolved with a small, localized fix 
once the intent is understood.
   
   **Path:** .github/workflows/ephemeral-env.yml
   **Line:** 324:333
   **Comment:**
        *CRITICAL: This change assumes step outputs can be moved into env vars 
without changing their shape, but `steps.list-tasks.outputs.task` and 
`steps.get-eni.outputs.eni` are produced via `jq` (without `-r`) and therefore 
include JSON quotes; when passed through `$TASK_ARN` / `$ENI_ID`, those quotes 
become literal characters and can break the AWS CLI calls in the normal 
ephemeral-env-up path.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   If a suggested approach is provided above, use it as the authoritative 
instruction. If no explicit code suggestion is given, you MUST still draft and 
apply your own minimal, localized fix — do not punt back with 'no suggestion 
provided, review manually'. Keep the change as small as possible: add a guard 
clause, gate on a loading state, reorder an await, wrap in a conditional, etc. 
Do not refactor surrounding code or expand scope beyond the finding.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to