diff --git a/.github/policies/msgraph-beta-sdk-python-branch-protection.yml b/.github/policies/msgraph-beta-sdk-python-branch-protection.yml index c0c6a36d033..24b57cbb5a3 100644 --- a/.github/policies/msgraph-beta-sdk-python-branch-protection.yml +++ b/.github/policies/msgraph-beta-sdk-python-branch-protection.yml @@ -8,40 +8,37 @@ description: Branch protection policy for the msgraph-beta-sdk-python repository resource: repository configuration: branchProtectionRules: + - branchNamePattern: main + # This branch pattern applies to the following branches: + # main - - - branchNamePattern: main - # This branch pattern applies to the following branches: - # main - - # Specifies whether this branch can be deleted. boolean - allowsDeletions: false - # Specifies whether forced pushes are allowed on this branch. boolean - allowsForcePushes: false - # Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean - dismissStaleReviews: true - # Specifies whether admins can overwrite branch protection. boolean - isAdminEnforced: false - # Indicates whether "Require a pull request before merging" is enabled. boolean - requiresPullRequestBeforeMerging: true - # Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required - requiredApprovingReviewsCount: 1 - # Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean - requireCodeOwnersReview: true - # Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines. - requiresCommitSignatures: false - # Are conversations required to be resolved before merging? boolean - requiresConversationResolution: true - # Are merge commits prohibited from being pushed to this branch. boolean - requiresLinearHistory: false - # Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status - requiredStatusChecks: - - CodeQL - - Validate code accuracy - # Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean - requiresStrictStatusChecks: true - # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. - restrictsPushes: false - # Restrict who can dismiss pull request reviews. boolean - restrictsReviewDismissals: false - + # Specifies whether this branch can be deleted. boolean + allowsDeletions: false + # Specifies whether forced pushes are allowed on this branch. boolean + allowsForcePushes: false + # Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean + dismissStaleReviews: true + # Specifies whether admins can overwrite branch protection. boolean + isAdminEnforced: false + # Indicates whether "Require a pull request before merging" is enabled. boolean + requiresPullRequestBeforeMerging: true + # Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required + requiredApprovingReviewsCount: 1 + # Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean + requireCodeOwnersReview: true + # Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines. + requiresCommitSignatures: false + # Are conversations required to be resolved before merging? boolean + requiresConversationResolution: true + # Are merge commits prohibited from being pushed to this branch. boolean + requiresLinearHistory: false + # Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status + requiredStatusChecks: + - CodeQL + - check-build-matrix + # Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean + requiresStrictStatusChecks: true + # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. + restrictsPushes: false + # Restrict who can dismiss pull request reviews. boolean + restrictsReviewDismissals: false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 765f3a26499..8f8c0ffc529 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,12 +12,16 @@ jobs: validate: name: Validate code accuracy runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -25,3 +29,17 @@ jobs: - name: Lint with Pylint run: pylint msgraph_beta --disable=W --rcfile=.pylintrc + + # The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure. + # Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks. + check-build-matrix: + runs-on: ubuntu-latest + needs: validate + if: always() + steps: + - name: All build matrix options are successful + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: One or more build matrix options failed + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 592ce174912..85884d21280 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -aiohttp==3.11.9 +aiohttp==3.10.11 aiosignal==1.3.1 anyio==4.6.2 -astroid==3.3.5 +astroid==3.2.4 async-timeout==5.0.1 attrs==24.2.0 azure-core==1.32.0 @@ -16,7 +16,7 @@ colorama==0.4.6 cryptography==44.0.0 Deprecated==1.2.15 dill==0.3.9 -docutils==0.21.2 +docutils==0.20.1 flit==3.10.1 flit_core==3.10.1 frozenlist==1.5.0 @@ -55,18 +55,18 @@ pendulum==3.0.0 platformdirs==4.3.6 portalocker==2.10.1 pycparser==2.22 -PyJWT==2.10.1 -pylint==3.3.2 +PyJWT==2.9.0 +pylint==3.2.6 pyproject_hooks==1.2.0 python-dateutil==2.9.0.post0 requests==2.32.3 six==1.16.0 sniffio==1.3.1 std-uritemplate==2.0.0 -time-machine==2.16.0 +time-machine==2.15.0 toml==0.10.2 tomli==2.2.1 -tomli_w==1.1.0 +tomli_w==1.0.0 tomlkit==0.13.2 typing_extensions==4.12.2 tzdata==2024.2 @@ -74,5 +74,5 @@ uritemplate==4.1.1 urllib3==2.2.3 wrapt==1.17.0 yapf==0.43.0 -yarl==1.18.3 -zipp==3.21.0 +yarl==1.15.2 +zipp==3.20.1