diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index fc690e0b..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,33 +0,0 @@ - - - -## Intent - - - - - -## Type of Change - - - -- [ ] Bug Fix -- [ ] New Feature -- [ ] Breaking Change - -## Approach - - - -## Automated Tests - - - -## Directions for Reviewers - - -## Checklist - - -- [ ] I have updated [CHANGELOG.md](../CHANGELOG.md) to cover notable changes. -- [ ] I have updated all related GitHub issues to reflect their current state. diff --git a/.github/workflows/deploy_tests.yml b/.github/workflows/deploy_tests.yml deleted file mode 100644 index 41be6d54..00000000 --- a/.github/workflows/deploy_tests.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: rsconnect-python-tests-at-night -on: - schedule: - - cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT - workflow_dispatch: - -jobs: - distributions: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/setup-python@v4 - with: - python-version: 3.8.x - - run: pip install -e '.[test]' - - run: pip freeze - - run: make dist - id: create_dist - - uses: actions/upload-artifact@v4 - with: - name: distributions - path: dist/ - - test-connect: - needs: distributions - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - PY_VERSION: - - 3.11.7 - - 3.12.1 - steps: - - uses: extractions/setup-just@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Delete unused stuff to save space - run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android - - - uses: actions/checkout@v4 - with: - repository: rstudio/connect - path: 'test/connect-rsconnect-python' - sparse-checkout: | - test/rsconnect-python - tools/dev - examples - sparse-checkout-cone-mode: false - token: ${{ secrets.CONNECT_PAT }} - - - name: Build docker container-image - run: | - cd test/connect-rsconnect-python/test/rsconnect-python/ - docker compose --profile rsconnect build - - - name: Restore dist - uses: actions/download-artifact@v4 - with: - name: distributions - path: dist/ - - - name: Run rsconnect-python Tests - env: - CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}" - PY_VERSION: ${{ matrix.PY_VERSION }} - CONNECT_CONFIG: "test-rsconnect-python.gcfg" - TEST_SUBSET: "ALL" - RSC_AUTOMATION_PAT: "${{ secrets.CONNECT_PAT }}" - ADMIN_API_KEY: "${{ secrets.ADMIN_API_KEY }}" - QUARTO_VERSION: "1.4.546" - # This allows us to start Connect separately in our own docker container - CONNECT_SERVER: "http://localhost:3939" - remote: "yes" - run: | - cd integration-testing - docker compose build connect-cli - docker compose build client-cli - docker compose up -d connect-cli - docker compose up -d client-cli - docker compose run --rm client-cli just ../test/connect-rsconnect-python/test/rsconnect-python/_start-dev - - # Videos are captured whether the suite fails or passes - - name: Save videos - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-videos_${{ matrix.PY_VERSION }}_native - path: test/connect-rsconnect-python/cypress/videos - if-no-files-found: ignore - - # Screenshots are only captured on failure - - name: Save screenshots - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-screenshots_${{ matrix.PY_VERSION }}_native - path: test/connect-rsconnect-python/cypress/screenshots - if-no-files-found: ignore - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 208e81de..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,254 +0,0 @@ -name: main -on: - push: - branches: [main] - tags: ['*'] - schedule: - - cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT - pull_request: - branches: [main] - workflow_dispatch: - -permissions: - id-token: write - contents: write - pull-requests: write - -jobs: - test: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - include: - - os: macos-latest - python-version: '3.9' - - os: windows-latest - python-version: '3.9' - runs-on: ${{ matrix.os }} - name: test (py${{ matrix.python-version }} ${{ matrix.os }}) - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - run: pip install '.[test]' - - run: pip freeze - - run: make lint - - run: rsconnect version - - run: make test-${{ matrix.python-version }} - - if: github.event_name == 'pull_request' && matrix.python-version == '3.8' - uses: orgoro/coverage@v3 - with: - coverageFile: coverage.xml - token: ${{ secrets.GITHUB_TOKEN }} - - prerelease-test: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-python@v4 - with: - python-version: 3.8.x - - run: pip install --pre '.[test]' - - run: pip freeze - - run: make lint - - run: rsconnect version - - run: make test-3.8 - - distributions: - needs: test - strategy: - matrix: - package_name: ["rsconnect_python", "rsconnect"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-python@v4 - with: - python-version: 3.8.x - - name: Install uv # see scripts/temporary-rename - uses: astral-sh/setup-uv@v6 - - run: pip install -e '.[test]' - - run: pip freeze - - run: make dist - id: create_dist - env: - PACKAGE_NAME: ${{ matrix.package_name }} - - uses: actions/upload-artifact@v4 - with: - name: distributions - path: dist/ - if: matrix.package_name == 'rsconnect_python' - - run: pip install -vvv ${{ steps.create_dist.outputs.whl }} - - run: rsconnect version - - run: rsconnect --help - - name: create github release - uses: softprops/action-gh-release@v2 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.package_name == 'rsconnect_python' - with: - files: | - dist/*.whl - token: ${{ secrets.GITHUB_TOKEN }} - - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - - docs: - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install uv - uses: astral-sh/setup-uv@v6 - with: - python-version: 3.12 - - name: build docs - run: make docs - - uses: actions/upload-artifact@v4 - with: - name: docs - path: site/ - - uses: aws-actions/configure-aws-credentials@v4 - id: creds - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: make sync-latest-docs-to-s3 - - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.DOCS_AWS_ROLE }} - aws-region: us-east-1 - - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: make promote-docs-in-s3 - - test-rsconnect: - name: "Integration tests against latest Connect" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.12.4 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r vetiver-testing/vetiver-requirements.txt - python -m pip install '.[test]' - - name: Run RStudio Connect - run: | - docker compose up --build -d - pip freeze > requirements.txt - make dev - env: - RSC_LICENSE: ${{ secrets.RSC_LICENSE }} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Get logs in case of failure - run: | - docker compose logs rsconnect - if: ${{ failure() }} - - # NOTE: edited to run checks for python package - - name: Run tests - run: | - pytest tests/test_main_system_caches.py - pytest -m 'vetiver' - - test-connect: - needs: distributions - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - PY_VERSION: - - 3.11.7 - - 3.12.1 - steps: - - uses: extractions/setup-just@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Checkout the rsconnect-python tests from Connect - - uses: actions/checkout@v4 - with: - repository: rstudio/connect - path: 'test/connect-rsconnect-python' - sparse-checkout: | - test/rsconnect-python - tools/dev - examples - sparse-checkout-cone-mode: false - token: ${{ secrets.CONNECT_PAT }} - - - name: Delete dotnet to save space - run: sudo rm -rf /usr/share/dotnet - - - name: Build docker container-image - run: | - cd test/connect-rsconnect-python/test/rsconnect-python/ - docker compose --profile rsconnect build - - - name: Restore dist - uses: actions/download-artifact@v4 - with: - name: distributions - path: dist/ - - - name: Run rsconnect-python Tests - env: - CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}" - PY_VERSION: ${{ matrix.PY_VERSION }} - TEST_SUBSET: "CI" - RSC_AUTOMATION_PAT: "${{ secrets.CONNECT_PAT }}" - ADMIN_API_KEY: "${{ secrets.ADMIN_API_KEY }}" - QUARTO_VERSION: "1.4.546" - - # This allows us to start Connect separately in our own docker container - CONNECT_SERVER: "http://localhost:3939" - remote: "yes" - run: | - cd integration-testing - docker compose pull connect - docker compose up -d connect - just ../test/connect-rsconnect-python/test/rsconnect-python/test-rsconnect-python-repo - - # Videos are captured whether the suite fails or passes - - name: Save videos - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-videos_${{ matrix.PY_VERSION }}_native - path: test/connect-rsconnect-python/cypress/videos - if-no-files-found: ignore - - # Screenshots are only captured on failure - - name: Save screenshots - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-screenshots_${{ matrix.PY_VERSION }}_native - path: test/connect-rsconnect-python/cypress/screenshots - if-no-files-found: ignore diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml deleted file mode 100644 index ebdf47b2..00000000 --- a/.github/workflows/preview-docs.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: preview docs - -on: - pull_request: - types: - - opened - - reopened - - synchronize - - closed - workflow_dispatch: - -concurrency: preview-${{ github.ref }} - -jobs: - deploy-preview: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - - name: Install and Build - if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed - run: | - python -m pip install -e ".[docs]" - mkdocs build - - - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 - with: - source-dir: ./site/ diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml deleted file mode 100644 index 2425aac8..00000000 --- a/.github/workflows/snyk.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: snyk -on: - schedule: - - cron: "0 10 * * 1" # Monday @ 10am UTC - workflow_dispatch: - push: - paths: - - pyproject.toml - - '.github/workflows/snyk.yml' - -env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - SNYK_ORG: posit-connect-tools - -jobs: - snyk-monitor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up uv and Python - uses: astral-sh/setup-uv@v6 - with: - python-version: '3.11' - activate-environment: true - - - name: Prepare requirements.txt - run: | - uv pip compile pyproject.toml --output-file requirements.txt - uv pip install -r requirements.txt - - - uses: snyk/actions/setup@master - - - name: Run Snyk (requirements.txt) - run: snyk monitor --file="requirements.txt" --package-manager=pip --project-name="requirements.txt" --org=${{ env.SNYK_ORG }} diff --git a/.snyk b/.snyk new file mode 100644 index 00000000..57e006cb --- /dev/null +++ b/.snyk @@ -0,0 +1,6 @@ +# Snyk (https://snyk.io) policy file +--- +exclude: + global: + - tests/** + - vetiver-testing/**