From 8a64dcc06a195f3b8ffa3f7d3d541863dcb347c9 Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:32:31 -0800 Subject: [PATCH 1/9] Refactor CI pipeline configuration for 1ESPR template build --- .azdo/ci-pr.yaml | 107 +++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 46 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index 2a2c566..b9c1a6f 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -6,52 +6,67 @@ pr: trigger: none # Only run on PRs, not on direct pushes -pool: - vmImage: ubuntu-latest +resources: + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + pool: + name: Azure-Pipelines-1ESPT-ExDShared + image: ubuntu-latest + os: linux + stages: + - stage: stage + jobs: + - job: PythonBuild # Simplified to single Python version (per project requirements) # Can expand to matrix testing later if needed - -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '3.12' - addToPath: true - displayName: 'Use Python 3.12' - -- script: | - python -m pip install --upgrade pip - python -m pip install flake8 black build - if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi - displayName: 'Install dependencies' - -- script: | - black src tests --check - displayName: 'Check format with black' - continueOnError: true # TODO: fix detected formatting errors and remove this line - -- script: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings - flake8 . --count --exit-zero --show-source --statistics - displayName: 'Lint with flake8' - -- script: | - python -m build - displayName: 'Build package' - -- script: | - python -m pip install dist/*.whl - displayName: 'Install wheel' - -- script: | - pytest - displayName: 'Test with pytest' - -- task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testResultsFiles: '**/test-*.xml' - testRunTitle: 'Python 3.12' - displayName: 'Publish test results' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.12' + addToPath: true + displayName: 'Use Python 3.12' + + - script: | + python -m pip install --upgrade pip + python -m pip install flake8 black build + if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi + displayName: 'Install dependencies' + + - script: | + black src tests --check + displayName: 'Check format with black' + continueOnError: true # TODO: fix detected formatting errors and remove this line + + - script: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings + flake8 . --count --exit-zero --show-source --statistics + displayName: 'Lint with flake8' + + - script: | + python -m build + displayName: 'Build package' + + - script: | + python -m pip install dist/*.whl + displayName: 'Install wheel' + + - script: | + pytest + displayName: 'Test with pytest' + + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testResultsFiles: '**/test-*.xml' + testRunTitle: 'Python 3.12' + displayName: 'Publish test results' From eece06d4727d27494f1823dbdf88c2d7c5ee0e77 Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:34:47 -0800 Subject: [PATCH 2/9] Comment out 'os' parameter in ci-pr.yaml Comment out the 'os' parameter in the CI configuration. --- .azdo/ci-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index b9c1a6f..f62c019 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -18,7 +18,7 @@ extends: pool: name: Azure-Pipelines-1ESPT-ExDShared image: ubuntu-latest - os: linux + # os: linux stages: - stage: stage From f83276eeea0ef69d4a6d9ebda73c1a86a89c6bfc Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:40:01 -0800 Subject: [PATCH 3/9] Rename stage and job in CI pipeline configuration --- .azdo/ci-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index f62c019..fb70bfc 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -21,9 +21,9 @@ extends: # os: linux stages: - - stage: stage + - stage: Build jobs: - - job: PythonBuild + - job: Python # Simplified to single Python version (per project requirements) # Can expand to matrix testing later if needed From 8bd91953933db67f000f7fd820959bf4a615f3bf Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:43:27 -0800 Subject: [PATCH 4/9] Update .azdo/ci-pr.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .azdo/ci-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index fb70bfc..f77666b 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -24,8 +24,8 @@ extends: - stage: Build jobs: - job: Python -# Simplified to single Python version (per project requirements) -# Can expand to matrix testing later if needed + # Simplified to single Python version (per project requirements) + # Can expand to matrix testing later if needed steps: - task: UsePythonVersion@0 From a6174b01add7654b7eadd5e3e303cf3a2e188aae Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:43:48 -0800 Subject: [PATCH 5/9] Uncomment OS parameter in CI configuration --- .azdo/ci-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index f77666b..b5f5e9a 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -18,7 +18,7 @@ extends: pool: name: Azure-Pipelines-1ESPT-ExDShared image: ubuntu-latest - # os: linux + os: linux stages: - stage: Build From e4fdb0210b37afc5825c9731cf796ebd508d6ca1 Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:47:02 -0800 Subject: [PATCH 6/9] Change pipeline template to unofficial version --- .azdo/ci-pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index b5f5e9a..852664c 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -12,8 +12,9 @@ resources: type: git name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release + extends: - template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: pool: name: Azure-Pipelines-1ESPT-ExDShared From 48efac6a350b0236bb85fa03ea687ac81e8712f7 Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:48:38 -0800 Subject: [PATCH 7/9] Comment out image parameter in ci-pr.yaml Comment out the image parameter in the CI pipeline configuration. --- .azdo/ci-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index 852664c..9ef2d08 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -18,7 +18,7 @@ extends: parameters: pool: name: Azure-Pipelines-1ESPT-ExDShared - image: ubuntu-latest + # image: ubuntu-latest os: linux stages: From a8657bec3bbba9a5b3a25e171eae79c1bcac982e Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 12:50:57 -0800 Subject: [PATCH 8/9] Update ci-pr.yaml --- .azdo/ci-pr.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index 9ef2d08..c6ecf5b 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -18,9 +18,13 @@ extends: parameters: pool: name: Azure-Pipelines-1ESPT-ExDShared - # image: ubuntu-latest + image: ubuntu-latest os: linux - + sdl: + sourceAnalysisPool: + name: Azure-Pipelines-1ESPT-ExDShared # Name of your hosted pool + image: ubuntu-latest + os: linux stages: - stage: Build jobs: From a84baa73364f8c868c110d778bc0f1507aea7cf8 Mon Sep 17 00:00:00 2001 From: Bo Brogaard Lund Date: Fri, 14 Nov 2025 14:21:40 -0800 Subject: [PATCH 9/9] Update ci-pr.yaml --- .azdo/ci-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index 858761d..298df00 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -23,8 +23,8 @@ extends: sdl: sourceAnalysisPool: name: Azure-Pipelines-1ESPT-ExDShared # Name of your hosted pool - image: ubuntu-latest - os: linux + image: windows-latest + os: windows stages: - stage: Build jobs: