GeezerVison is showing github.com — Eric/cus 9 - Socket CLI v2 (#50) · SocketDev/socket-python-cli@49156d4
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +5Lines changed: 5 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Click on the "Preview" tab and select appropriate PR template: | | 2 | + | | 3 | +[New Feature](?expand=1&template=feature.md) | | 4 | +[Bug Fix](?expand=1&template=bug-fix.md) | | 5 | +[Improvement](?expand=1&template=improvement.md) |
Collapse file Copy file name to clipboard +19Lines changed: 19 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +<!--Description: Briefly describe the bug and its impact. If there's a related Linear ticket or Sentry issue, link it here. ⬇️ --> | | 2 | + | | 3 | +## Root Cause | | 4 | +<!-- Concise explanation of what caused the bug ⬇️ --> | | 5 | + | | 6 | + | | 7 | + | | 8 | +## Fix | | 9 | +<!-- Explain how your changes address the bug ⬇️ --> | | 10 | + | | 11 | +## Public Changelog | | 12 | +<!-- Write a changelog message between comment tags if this should be included in the public product changelog, Leave blank otherwise. --> | | 13 | + | | 14 | +<!-- changelog ⬇️--> | | 15 | +N/A | | 16 | +<!-- /changelog ⬆️ --> | | 17 | + | | 18 | + | | 19 | +<!-- TEMPLATE TYPE DON'T REMOVE: python-cli-template-bug-fix --> |
Collapse file Copy file name to clipboard +16Lines changed: 16 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +<!-- Description: Briefly describe the new feature you're introducing ⬇️ --> | | 2 | + | | 3 | + | | 4 | +## Why? | | 5 | +<!-- Explain the motivation behind this feature and its expected benefits ⬇️ --> | | 6 | + | | 7 | + | | 8 | + | | 9 | +## Public Changelog | | 10 | +<!-- Write a changelog message between comment tags if this should be included in the public product changelog. --> | | 11 | + | | 12 | +<!-- changelog ⬇️--> | | 13 | +N/A | | 14 | +<!-- /changelog ⬆️ --> | | 15 | + | | 16 | +<!-- TEMPLATE TYPE DON'T REMOVE: python-cli-template-feature --> |
Collapse file Copy file name to clipboard +10Lines changed: 10 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +<!-- Description: Briefly describe the code improvement you're making. This could include things like lint fixes, adding monitoring dashboards, optimizing scripts, refactoring, etc. ⬇️ --> | | 2 | + | | 3 | +## Public Changelog | | 4 | +<!-- Write a changelog message between comment tags if this should be included in the public product changelog. --> | | 5 | + | | 6 | +<!-- changelog ⬇️--> | | 7 | +N/A | | 8 | +<!-- /changelog ⬆️ --> | | 9 | + | | 10 | +<!-- TEMPLATE TYPE DON'T REMOVE: python-cli-template-improvement --> |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/pr-preview.yml +9-3Lines changed: 9 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | name: PR Preview | 2 | 2 | on: | 3 | 3 | pull_request: | 4 | | - types: [opened, synchronize] | | 4 | + types: [opened, synchronize, ready_for_review] | 5 | 5 |
| 6 | 6 | jobs: | 7 | 7 | preview: | | 12 | 12 | with: | 13 | 13 | python-version: '3.x' | 14 | 14 |
| | 15 | + # Install all dependencies from pyproject.toml | | 16 | + - name: Install dependencies | | 17 | + run: | | | 18 | + python -m pip install --upgrade pip | | 19 | + pip install -e . | | 20 | +
| 15 | 21 | - name: Set preview version | 16 | 22 | run: | | 17 | | - BASE_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'") | | 23 | + BASE_VERSION=$(python -c "from socketsecurity import __version__; print(__version__)") | 18 | 24 | PREVIEW_VERSION="${BASE_VERSION}.dev${{ github.event.pull_request.number }}${{ github.event.pull_request.commits }}" | 19 | 25 | echo "VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV | 20 | 26 |
| | 25 | 31 |
| 26 | 32 | # Verify the change | 27 | 33 | echo "Updated version in __init__.py:" | 28 | | - cat socketsecurity/__init__.py | grep "__version__" | | 34 | + python -c "from socketsecurity import __version__; print(__version__)" | 29 | 35 |
| 30 | 36 | - name: Check if version exists on Test PyPI | 31 | 37 | id: version_check | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/release.yml +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | with: | 14 | 14 | python-version: '3.x' | 15 | 15 |
| | 16 | + # Install all dependencies from pyproject.toml | | 17 | + - name: Install dependencies | | 18 | + run: | | | 19 | + python -m pip install --upgrade pip | | 20 | + pip install -e . | | 21 | + | 16 | 22 | - name: Get Version | 17 | 23 | id: version | 18 | 24 | run: | | @@ -104,4 +110,4 @@ jobs: | 104 | 110 | socketdev/cli:latest | 105 | 111 | socketdev/cli:${{ env.VERSION }} | 106 | 112 | build-args: | | 107 | | - CLI_VERSION=${{ env.VERSION }} | | 113 | + CLI_VERSION=${{ env.VERSION }} |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/version-check.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | name: Version Check | 2 | 2 | on: | 3 | 3 | pull_request: | 4 | | - types: [opened, synchronize] | | 4 | + types: [opened, synchronize, ready_for_review] | 5 | 5 | paths: | 6 | 6 | - 'socketsecurity/**' | 7 | 7 | - 'setup.py' | |
Collapse file Copy file name to clipboardExpand all lines: .gitignore +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | *.build | 7 | 7 | *.dist | 8 | 8 | *.egg-info | 9 | | -test | 10 | 9 | *.env | 11 | 10 | run_container.sh | 12 | 11 | *.zip | 13 | 12 | bin | 14 | 13 | scripts/*.py | 15 | 14 | *.json | | 15 | +!tests/**/*.json | 16 | 16 | markdown_overview_temp.md | 17 | 17 | markdown_security_temp.md | 18 | 18 | .DS_Store | 19 | 19 | *.pyc | 20 | 20 | test.py | 21 | 21 | *.cpython-312.pyc` | 22 | 22 | file_generator.py | 23 | | -.env.local | | 23 | +.coverage | | 24 | +.env.local | | 25 | +Pipfile |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +3.12 |
Collapse file Copy file name to clipboard +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | FROM python:3-alpine | 2 | 2 | LABEL org.opencontainers.image.authors="socket.dev" | 3 | 3 | ARG CLI_VERSION | | 4 | +ARG SDK_VERSION | 4 | 5 | ARG PIP_INDEX_URL=https://pypi.org/simple | 5 | 6 | ARG PIP_EXTRA_INDEX_URL=https://pypi.org/simple | 6 | 7 |
| 7 | 8 | RUN apk update \ | 8 | 9 | && apk add --no-cache git nodejs npm yarn | 9 | 10 |
| 10 | | -RUN pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION \ | 11 | | - && socketcli -v \ | 12 | | - && socketcli -v | grep -q $CLI_VERSION | | 11 | +# Install CLI with retries for TestPyPI propagation (10 attempts, 30s each = 5 minutes total) | | 12 | +RUN for i in $(seq 1 10); do \ | | 13 | + echo "Attempt $i/10: Installing socketsecurity==$CLI_VERSION"; \ | | 14 | + if pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \ | | 15 | + break; \ | | 16 | + fi; \ | | 17 | + echo "Install failed, waiting 30s before retry..."; \ | | 18 | + sleep 30; \ | | 19 | + done && \ | | 20 | + if [ ! -z "$SDK_VERSION" ]; then \ | | 21 | + pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socket-sdk-python==${SDK_VERSION}; \ | | 22 | + fi |
|