Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for compare-refdata pipeline #1996

Merged
merged 3 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .azure-pipelines/compare-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''

Expand All @@ -35,7 +34,7 @@ jobs:
- template: templates/default.yml
parameters:
fetchRefdata: true
refdataRepo: 'azure'
refdataRepo: 'azure' # use 'github' when comparing between custom ref hashes
useMamba: false

- bash: |
Expand All @@ -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
Expand Down Expand Up @@ -97,11 +101,10 @@ jobs:

- bash: |
ssh [email protected] "mkdir -p /home/azuredevops/public_html/files/refdata-results/$(subfolder)"
scp $(refdata.dir)/notebooks/ref_data_compare.html [email protected]:/home/azuredevops/public_html/files/refdata-results/$(pr.number)/$(commit.sha).html
scp $(refdata.dir)/notebooks/ref_data_compare.html [email protected]:/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:
Expand Down
13 changes: 9 additions & 4 deletions .azure-pipelines/templates/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -50,9 +50,14 @@ steps:
fetchDepth: ${{ parameters.fetchDepth }}

- ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'azure')) }}:
- checkout: git://TARDIS/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://[email protected]/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: |
Expand Down