chore: add scripts for metadata and shasum validation#6869
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
/describe |
|
PR Description updated to latest commit (c6c758c) |
ca659fb to
b69c16f
Compare
This comment has been minimized.
This comment has been minimized.
b69c16f to
8680bd6
Compare
This comment has been minimized.
This comment has been minimized.
8680bd6 to
f0e6f84
Compare
This comment has been minimized.
This comment has been minimized.
f0e6f84 to
4995920
Compare
This comment has been minimized.
This comment has been minimized.
| #!/usr/bin/env bash | ||
| # Prints the Linux binary asset name (snyk-linux or snyk-linux-arm64) to stdout. | ||
|
|
||
| ARCH="$(uname -m)" | ||
| if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then | ||
| echo "snyk-linux-arm64" | ||
| else | ||
| echo "snyk-linux" | ||
| fi |
There was a problem hiding this comment.
I would think that these small helpers could be together and we just call them as functions somehow, so we avoid scattering in multiple files. But in general it is ok. Maybe we could see opinion of other people about this refactoring
There was a problem hiding this comment.
Personally, I prefer to have them as separate files, because
- there is no need to source the whole file along with all its functions
- separation of concerns: one bash script -> one single function
- we avoid "utils.sh" jumbles
Thanks for your opinion though. Maybe others think in a different way than me.
There was a problem hiding this comment.
The refactoring looks better when looking at the high level file, nice improvement!
Yes, I was looking at this when I got dragged by other task. I am working on it |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
and from the lastest pr bot review:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I consider all those fixed - this is never ending |
daecd57 to
fffdcb4
Compare
fffdcb4 to
a510ef2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
PR Reviewer Guide 🔍
|
|
danskmt
left a comment
There was a problem hiding this comment.
From a high-level point of view (the scripts for capture) they look good. For the other scripts that are in different files, I would think of merging them to a file with separate functions that can be called separately. But this is just personal preference.
Maybe you want to take someone else's opinion, but I believe is good to go
chore: add scripts for metadata and shasum validation





User description
This PR
deployment-monitor.ymlto separate scriptsBoth changes aim for readability and sustainability.
In detail:
.github/scripts/deployment-monitor/capture-linux-metadata.shmonitor_npmandmonitor_snyk_imagesjobs..github/scripts/deployment-monitor/capture-homebrew-metadata.shmonitor_homebrewjob..github/scripts/deployment-monitor/compare-snyk-versions.shcompare_versionsjob..github/scripts/deployment-monitor/helpers/*.github/scripts/deployment-monitor/cmd/*.github/workflows/deployment-monitor.ymlPull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
Where should the reviewer start?
How should this be manually tested?
What's the product update that needs to be communicated to CLI users?
PR Type
Enhancement
Description
Diagram Walkthrough
flowchart LR subgraph "New Scripts" A[compare-cdn-shasums.go] B[extract-release-json-hash.go] C[is-elf-binary.go] D[capture-homebrew-metadata.sh] E[capture-linux-metadata.sh] F[compare-snyk-versions.sh] G[helpers] end subgraph "Existing Workflow" H[deployment-monitor.yml] end H -- "Orchestrates and calls" --> A H -- "Orchestrates and calls" --> B H -- "Orchestrates and calls" --> C H -- "Orchestrates and calls" --> D H -- "Orchestrates and calls" --> E H -- "Orchestrates and calls" --> F H -- "Orchestrates and calls" --> G D -- "Uses helper" --> G E -- "Uses helper" --> G F -- "Uses helper" --> G A -- "Uses tool" --> C E -- "Uses tool" --> C D -- "Uses tool" --> BFile Walkthrough
Deployment Tests > Run workflow > this branch
Successful test