sadpandajoe commented on code in PR #45217:
URL: https://github.com/apache/superset/pull/45217#discussion_r4258400204


##########
.github/actions/setup-develocity-npm/action.yml:
##########
@@ -0,0 +1,34 @@
+name: "Setup Develocity for npm"
+description: "Installs the Develocity npm agent so that npm runs publish Build 
Scans to develocity.apache.org"
+inputs:
+  develocity-access-key:
+    description: "Access key for develocity.apache.org; the action exchanges 
it for a short-lived token"
+    required: true
+outputs:
+  agent-installed:
+    description: "'true' when the agent is present under /tmp/develocity-npm, 
so jobs can safely preload it"
+    value: ${{ steps.check-agent.outputs.installed }}
+runs:
+  using: "composite"
+  steps:
+    - name: Setup Develocity for npm
+      uses: 
gradle/develocity-actions/setup-npm@9d8792ab22712b19790c2abce53e9ebb2694c312 # 
v2.5
+      with:
+        develocity-url: https://develocity.apache.org
+        develocity-access-key: ${{ inputs.develocity-access-key }}
+        develocity-injection-enabled: true
+        develocity-npm-agent-version: 4.1.1
+        # Fixed location, so the frontend container jobs can mount the agent
+        develocity-npm-agent-install-location: /tmp/develocity-npm
+    # The setup above only logs a warning when the agent download fails, so
+    # check the agent is actually there before callers preload it
+    - name: Check Develocity npm agent
+      id: check-agent
+      shell: bash
+      run: |
+        if [ -f /tmp/develocity-npm/@gradle-tech/develocity-agent/package.json 
]; then

Review Comment:
   This only checks that the agent's `package.json` exists. If the download or 
extraction stops partway, `package.json` can be on disk while `dist/preload.js` 
is missing, so `agent-installed` still reports `true`. The container jobs then 
start with `--require=@gradle-tech/develocity-agent/preload` and Node fails 
with `Cannot find module`, which is the Develocity-outage failure the 
`continue-on-error` change is meant to prevent. Would it make sense to check 
the preload file itself?
   
   ```suggestion
           if [ -f 
/tmp/develocity-npm/@gradle-tech/develocity-agent/package.json ] && [ -f 
/tmp/develocity-npm/@gradle-tech/develocity-agent/dist/preload.js ]; then
   ```



-- 
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