Skip to content

Commit

Permalink
fix: updated snyk-python-plugin package version (#4859)
Browse files Browse the repository at this point in the history
  • Loading branch information
robh-snyk committed Sep 19, 2023
1 parent e632bd5 commit 51fe79b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ You may see some "Docker Hub" checks on your merge commit fail. This is normal a

After the `release-npm` job successfully completes, an automated process generates the Docker images for Snyk CLI. These images are then published to DockerHub under the repository [`snyk/snyk`](https://hub.docker.com/r/snyk/snyk).

## Upgrading the go-application-framework

If you have made changes to the `go-application-framework`, you can run `python3 scripts/upgrade-go-application-framework.py`. This will;

- Fetch the most recent commit from master of the framework
- Go get that version of the framework

You can then raise a pr with the relevant changes.

---

Questions? Ask Hammerhead 🔨
4 changes: 1 addition & 3 deletions cliv2/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/snyk/cli/cliv2

go 1.21

toolchain go1.21.0
go 1.18

require (
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a
Expand Down
24 changes: 24 additions & 0 deletions scripts/upgrade-go-application-framework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import requests
import subprocess

def get_latest_commit_sha():
url = f"https://api.github.com/repos/snyk/go-application-framework/commits"
headers = {
"Accept": "application/vnd.github.v3+json",
}
response = requests.get(url, headers=headers)
response.raise_for_status()
commits = response.json()
return commits[0]['sha']

def upgrade_go_application_framework(commit_sha):
subprocess.run(['go', 'get', '-u', f'github.com/snyk/go-application-framework@{commit_sha}'], cwd='./cliv2', check=True)
subprocess.run(['go', 'mod', 'tidy'], cwd='./cliv2', check=True)

if __name__ == "__main__":
try:
commit_sha = get_latest_commit_sha()
print(f"The most recent commit SHA for `go-application-framework` is: {commit_sha}")
upgrade_go_application_framework(commit_sha)
except Exception as e:
print(f"An error occurred: {e}")

0 comments on commit 51fe79b

Please sign in to comment.