From 6b8a5164a697e74df748d21ad85d4f3dbf94af9c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:06:25 -0500 Subject: [PATCH 01/10] ci: adds version matrix to ensure dependencies compatibility --- ...raph-beta-sdk-python-branch-protection.yml | 69 +++++++++---------- .github/workflows/build.yml | 22 +++++- 2 files changed, 53 insertions(+), 38 deletions(-) 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 From 00a6b5b0757c287cba2cd508afaa4f0d479d4187 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:12:36 -0500 Subject: [PATCH 02/10] fix: downgrades aiohttp to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 592ce174912..3d1a1b5ced4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -aiohttp==3.11.9 +aiohttp==3.10.11 aiosignal==1.3.1 anyio==4.6.2 astroid==3.3.5 From 3a8af15f3168e433a588968e4f808d904aa21107 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:13:31 -0500 Subject: [PATCH 03/10] fix: downgrades time-machine to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3d1a1b5ced4..8cbb09cad75 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -63,7 +63,7 @@ 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 From 8a9e7ef48ece01b40ea931307123760682c20814 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:13:54 -0500 Subject: [PATCH 04/10] fix: downgrades docutils to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8cbb09cad75..ca9c96b82f7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 From 9ebbc83d643f647fbccda117b438ae5167530ab4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:16:32 -0500 Subject: [PATCH 05/10] fix: downgrades astroid to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ca9c96b82f7..3b6bacfe02e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ 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 From 2650dd7ae6a604f29cd291e31615fca2edddaef9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:21:59 -0500 Subject: [PATCH 06/10] fix: downgrades PyJWT to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b6bacfe02e..fd5d5b7d8ab 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -55,7 +55,7 @@ pendulum==3.0.0 platformdirs==4.3.6 portalocker==2.10.1 pycparser==2.22 -PyJWT==2.10.1 +PyJWT==2.9.0 pylint==3.3.2 pyproject_hooks==1.2.0 python-dateutil==2.9.0.post0 From 51cf3baf7860d7c9e19efd5cd0cbe191442bc73b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:24:15 -0500 Subject: [PATCH 07/10] fix: downgrades pylint to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fd5d5b7d8ab..287c5ceb733 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -56,7 +56,7 @@ platformdirs==4.3.6 portalocker==2.10.1 pycparser==2.22 PyJWT==2.9.0 -pylint==3.3.2 +pylint==3.2.6 pyproject_hooks==1.2.0 python-dateutil==2.9.0.post0 requests==2.32.3 From 8329bae26aee1f79c712a9e87cc659ac43dc7f1e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:28:52 -0500 Subject: [PATCH 08/10] fix: downgrades tomli_w to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 287c5ceb733..28facaec8dd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -66,7 +66,7 @@ std-uritemplate==2.0.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 From ddbf2ced40dd9a1a29e3c4644b4e576a55ba0ee1 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:35:25 -0500 Subject: [PATCH 09/10] fix: downgrades yarl to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 28facaec8dd..bcbc6ea9428 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -74,5 +74,5 @@ uritemplate==4.1.1 urllib3==2.2.3 wrapt==1.17.0 yapf==0.43.0 -yarl==1.18.3 +yarl==1.15.2 zipp==3.21.0 From 58616fff8c858b2bd63d3d13207444d770638adb Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 4 Dec 2024 12:37:40 -0500 Subject: [PATCH 10/10] fix: downgrades zipp to match python supported versions --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bcbc6ea9428..85884d21280 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -75,4 +75,4 @@ urllib3==2.2.3 wrapt==1.17.0 yapf==0.43.0 yarl==1.15.2 -zipp==3.21.0 +zipp==3.20.1