diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..91abb11fdf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml new file mode 100644 index 0000000000..575c456ece --- /dev/null +++ b/.github/workflows/codacy.yml @@ -0,0 +1,61 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, performs a Codacy security scan +# and integrates the results with the +# GitHub Advanced Security code scanning feature. For more information on +# the Codacy security scan action usage and parameters, see +# https://github.com/codacy/codacy-analysis-cli-action. +# For more information on Codacy Analysis CLI in general, see +# https://github.com/codacy/codacy-analysis-cli. + +name: Codacy Security Scan + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '40 15 * * 2' + +permissions: + contents: read + +jobs: + codacy-security-scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + name: Codacy Security Scan + runs-on: ubuntu-latest + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout code + uses: actions/checkout@v3 + + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b + with: + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + # Adjust severity of non-security issues + gh-code-scanning-compat: true + # Force 0 exit code to allow SARIF file generation + # This will handover control about PR rejection to the GitHub side + max-allowed-issues: 2147483647 + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..e1aed6a3d9 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,76 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '29 12 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'python' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/docs-requirements.txt b/docs-requirements.txt index 04d1aff268..1148d511f3 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,2 +1,2 @@ -myst-parser==0.18.0 -Sphinx==5.1.1 +myst-parser==3.0.1 +Sphinx==7.2.6 diff --git a/requirements.txt b/requirements.txt index 36660b660c..f14c807b1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -packaging==21.3 -paramiko==2.11.0 -pywin32==304; sys_platform == 'win32' -requests==2.28.1 -urllib3==1.26.11 -websocket-client==1.3.3 +packaging==24.0 +paramiko==3.4.0 +pywin32==306; sys_platform == 'win32' +requests==2.32.2 +urllib3==2.2.1 +websocket-client==1.8.0 diff --git a/resonate.json b/resonate.json new file mode 100644 index 0000000000..3d36564df3 --- /dev/null +++ b/resonate.json @@ -0,0 +1,3 @@ +{ + "extends": ["github>sarvex/renovate-configs:rust"] +} diff --git a/reviewpad.yml b/reviewpad.yml new file mode 100644 index 0000000000..1a013a1358 --- /dev/null +++ b/reviewpad.yml @@ -0,0 +1,126 @@ +# This file is used to configure Reviewpad. +# The configuration is a proposal to help you get started. +# You can use it as a starting point and customize it to your needs. +# For more details see https://docs.reviewpad.com/guides/syntax. + +# Define the list of labels to be used by Reviewpad. +# For more details see https://docs.reviewpad.com/guides/syntax#label. +labels: + small: + description: Pull request is small + color: "#76dbbe" + medium: + description: Pull request is medium + color: "#2986cc" + large: + description: Pull request is large + color: "#c90076" + +# Define the list of workflows to be run by Reviewpad. +# A workflow is a list of actions that will be executed based on the defined rules. +# For more details see https://docs.reviewpad.com/guides/syntax#workflow. +workflows: + # This workflow calls Reviewpad AI agent to summarize the pull request. + - name: summarize + description: Summarize the pull request + run: + # Summarize the pull request on pull request synchronization. + - if: ($eventType() == "synchronize" || $eventType() == "opened") && $state() == "open" + then: $summarize() + + # This workflow assigns the most relevant reviewer to pull requests. + # This helps guarantee that most pull requests are reviewed by at least one person. + - name: reviewer-assignment + description: Assign the most relevant reviewer to pull requests + run: + # Automatically assign reviewer when the pull request is ready for review; + - if: $isDraft() == false + then: $assignCodeAuthorReviewers() + + # This workflow praises contributors on their pull request contributions. + # This helps contributors feel appreciated. + - name: praise-contributors-on-milestones + description: Praise contributors based on their contributions + run: + # Praise contributors on their first pull request. + - if: $pullRequestCountBy($author()) == 1 + then: $commentOnce($sprintf("Thank you @%s for this first contribution!", [$author()])) + + # This workflow validates that pull requests follow the conventional commits specification. + # This helps developers automatically generate changelogs. + # For more details, see https://www.conventionalcommits.org/en/v1.0.0/. + - name: check-conventional-commits + description: Validate that pull requests follow the conventional commits + run: + - if: $isDraft() == false + then: + # Check commits messages against the conventional commits specification + - $commitLint() + # Check pull request title against the conventional commits specification. + - $titleLint() + + # This workflow validates best practices for pull request management. + # This helps developers follow best practices. + - name: best-practices + description: Validate best practices for pull request management + run: + # Warn pull requests that do not have an associated GitHub issue. + - if: $hasLinkedIssues() == false + then: $warn("Please link an issue to the pull request") + # Warn pull requests if their description is empty. + - if: $description() == "" + then: $warn("Please provide a description for the pull request") + # Warn pull request do not have a clean linear history. + - if: $hasLinearHistory() == false + then: $warn("Please rebase your pull request on the latest changes") + + # This workflow labels pull requests based on the total number of lines changed. + # This helps pick pull requests based on their size and to incentivize small pull requests. + - name: size-labeling + description: Label pull request based on the number of lines changed + run: + - if: $size() < 100 + then: $addLabel("small") + else: $removeLabel("small") + - if: $size() >= 100 && $size() < 300 + then: $addLabel("medium") + else: $removeLabel("medium") + - if: $size() >= 300 + then: $addLabel("large") + else: $removeLabel("large") + + # This workflow signals pull requests waiting for reviews. + # This helps guarantee that pull requests are reviewed and approved by at least one person. + - name: check-approvals + description: Check that pull requests have the required number of approvals + run: + # Label pull requests with `waiting-for-review` if there are no approvals; + - if: $isDraft() == false && $approvalsCount() < 1 + then: $addLabel("waiting-for-review") + + # This workflow labels pull requests based on the pull request change type. + # This helps pick pull requests based on their change type. + - name: change-type-labelling + description: Label pull requests based on the type of changes + run: + # Label pull requests with `docs` if they only modify Markdown or txt files. + - if: $hasFileExtensions([".md", ".txt"]) + then: $addLabel("docs") + else: $removeLabel("docs") + # Label pull requests with `infra` if they modify Terraform files. + - if: $hasFileExtensions([".tf"]) + then: $addLabel("infra") + else: $removeLabel("infra") + # Label pull requests with `dependencies` if they only modify `package.json` and `package.lock` files. + - if: $hasFileExtensions(["package.json", "package-lock.json"]) + then: $addLabel("dependencies") + else: $removeLabel("dependencies") + + # This workflow validates that pull requests do not contain changes to the license. + # This helps avoid unwanted license modifications. + - name: license-validation + description: Validate that licenses are not modified + run: + # Fail Reviewpad check on pull requests that modify any LICENSE; + - if: $hasFilePattern("**/LICENSE*") + then: $fail("License files cannot be modified") diff --git a/test-requirements.txt b/test-requirements.txt index b7457fa773..e1f6d7769b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -setuptools==65.5.1 -coverage==6.4.2 -flake8==4.0.1 -pytest==7.1.2 -pytest-cov==3.0.0 -pytest-timeout==2.1.0 +setuptools==69.5.1 +coverage==7.5.3 +flake8==7.0.0 +pytest==8.2.1 +pytest-cov==4.1.0 +pytest-timeout==2.3.1