From f69b453daf648351b5d64d304463d1ddc798c2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Mon, 2 May 2022 12:50:22 -0300 Subject: [PATCH 1/3] Fix scp path in compare-refdata pipeline --- .azure-pipelines/compare-refdata.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure-pipelines/compare-refdata.yml b/.azure-pipelines/compare-refdata.yml index d2f531f9678..61996e15368 100644 --- a/.azure-pipelines/compare-refdata.yml +++ b/.azure-pipelines/compare-refdata.yml @@ -97,11 +97,10 @@ jobs: - bash: | ssh azuredevops@opensupernova.org "mkdir -p /home/azuredevops/public_html/files/refdata-results/$(subfolder)" - scp $(refdata.dir)/notebooks/ref_data_compare.html azuredevops@opensupernova.org:/home/azuredevops/public_html/files/refdata-results/$(pr.number)/$(commit.sha).html + scp $(refdata.dir)/notebooks/ref_data_compare.html azuredevops@opensupernova.org:/home/azuredevops/public_html/files/refdata-results/$(subfolder)/$(commit.sha).html displayName: 'Copy files to server' condition: succeededOrFailed() - # Run if the pipeline is triggered by a pull request. - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - task: GitHubComment@0 inputs: From 8d5fc379a7b001fe49a9172e3a310bd91d3dee27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Mon, 2 May 2022 14:11:59 -0300 Subject: [PATCH 2/3] Do not fetch pull requests if refdata source is Azure --- .azure-pipelines/compare-refdata.yml | 12 ++++++++---- .azure-pipelines/templates/default.yml | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/compare-refdata.yml b/.azure-pipelines/compare-refdata.yml index 61996e15368..305ccece823 100644 --- a/.azure-pipelines/compare-refdata.yml +++ b/.azure-pipelines/compare-refdata.yml @@ -19,10 +19,9 @@ pr: - '*' variables: - system.debug: false - results.url: 'http://opensupernova.org/~azuredevops/files/refdata-results' pr.number: '$(System.PullRequest.PullRequestNumber)' commit.sha: '$(Build.SourceVersion)' + results.url: 'http://opensupernova.org/~azuredevops/files/refdata-results' #ref1.hash: '' #ref2.hash: '' @@ -35,7 +34,7 @@ jobs: - template: templates/default.yml parameters: fetchRefdata: true - refdataRepo: 'azure' + refdataRepo: 'azure' # use 'github' to compare between custom ref hashes useMamba: false - bash: | @@ -47,9 +46,14 @@ jobs: cd $(refdata.dir) git remote add upstream $(git remote get-url origin) git fetch upstream - git fetch upstream "+refs/pull/*/head:refs/remotes/upstream/pr/*" displayName: 'Set upstream remote' + - ${{ if or(startsWith(variables['ref1.hash'], 'upstream/pr'), startsWith(variables['ref2.hash'], 'upstream/pr')) }}: + - bash: | + cd $(refdata.dir) + git fetch upstream "+refs/pull/*/head:refs/remotes/upstream/pr/*" + displayName: 'Fetch pull requests' + - bash: | cd $(tardis.dir) source activate tardis diff --git a/.azure-pipelines/templates/default.yml b/.azure-pipelines/templates/default.yml index aedecc84cb8..1b8846b418c 100644 --- a/.azure-pipelines/templates/default.yml +++ b/.azure-pipelines/templates/default.yml @@ -38,7 +38,7 @@ steps: - ${{ if eq(parameters.useMamba, false) }}: - bash: | echo "##vso[task.setvariable variable=package.manager]conda" - displayName: 'Set environment variables' + displayName: 'Set package manager' - ${{ if eq(parameters.useMamba, true) }}: - bash: | @@ -51,6 +51,7 @@ steps: - ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'azure')) }}: - checkout: git://TARDIS/tardis-refdata + path: s/tardis-refdata lfs: true displayName: 'Fetch reference data (Azure)' From 441b4b18867d514d6f3cee5a431a3dd062e8f335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 5 May 2022 13:57:39 -0300 Subject: [PATCH 3/3] Use old fetch method --- .azure-pipelines/compare-refdata.yml | 2 +- .azure-pipelines/templates/default.yml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/compare-refdata.yml b/.azure-pipelines/compare-refdata.yml index 305ccece823..c7baae41389 100644 --- a/.azure-pipelines/compare-refdata.yml +++ b/.azure-pipelines/compare-refdata.yml @@ -34,7 +34,7 @@ jobs: - template: templates/default.yml parameters: fetchRefdata: true - refdataRepo: 'azure' # use 'github' to compare between custom ref hashes + refdataRepo: 'azure' # use 'github' when comparing between custom ref hashes useMamba: false - bash: | diff --git a/.azure-pipelines/templates/default.yml b/.azure-pipelines/templates/default.yml index 1b8846b418c..8b3a3abf486 100644 --- a/.azure-pipelines/templates/default.yml +++ b/.azure-pipelines/templates/default.yml @@ -50,10 +50,14 @@ steps: fetchDepth: ${{ parameters.fetchDepth }} - ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'azure')) }}: - - checkout: git://TARDIS/tardis-refdata - path: s/tardis-refdata - lfs: true - displayName: 'Fetch reference data (Azure)' + # Azure Repos requires token auth for public repositories containing LFS objects (bug). + # Fetch reference data from Azure with a PAT until a fix arrives. + - bash: | + MY_PAT=$(refdata_token) + B64_PAT=$(printf ":$MY_PAT" | base64) + git -c http.extraHeader="Authorization: Basic ${B64_PAT}" clone https://tardis-sn@dev.azure.com/tardis-sn/TARDIS/_git/tardis-refdata $(refdata.dir) + cd $(refdata.dir); git -c http.extraHeader="Authorization: Basic ${B64_PAT}" lfs fetch --all + displayName: 'Fetch reference data repository' - ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'github')) }}: - bash: |