Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

[DEVOPS-1100] Catch errors in check-hydra.sh and exit appropriately #3762

Merged
merged 2 commits into from
Oct 18, 2018

Conversation

disassembler
Copy link
Contributor

@disassembler disassembler commented Oct 18, 2018

Description

Uses jq to parse output of hydra-eval-jobs. If hydra-eval-jobs exits failure it throws an error. If any attributes have an error key, it exits failure and prints all failing derivations.

This also fixes evals for hydra.

Linked issue

https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-1100

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it works, although shellcheck doesn't approve yet.
You could rebase this on latest master and fix the eval (remove attributes for cardano-report-server-static cardano-report-server cardano-sl-explorer-frontend from inherit block).
Then it will be good.

@disassembler disassembler force-pushed the devops-1100-hydra-eval-catch-errors branch 6 times, most recently from 4aea21d to 41590b3 Compare October 18, 2018 04:54
EVAL_EXIT_CODE="$?"
EVAL_TIME=$(cat eval-time.txt)
jq -r '.' < eval.json
jq -r 'map_values(.error)|to_entries[]|select(.value)|@text "\(.key): \(.value)"' < eval.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we output to stderr (> /dev/stderr), will buildkite show it in red?

@disassembler disassembler force-pushed the devops-1100-hydra-eval-catch-errors branch 4 times, most recently from 37e9a6a to cecb106 Compare October 18, 2018 05:47

nix-build https://github.com/nixos/nixpkgs/archive/4fb198892d298452023ab176e7067da58d30772e.tar.gz -A hydra
echo '~~~ Evaluating release.nix'
./result/bin/hydra-eval-jobs -I . release.nix
env time --format '%e' -o eval-time.txt ./result/bin/hydra-eval-jobs -I . release.nix > eval.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you want command not env

@disassembler disassembler force-pushed the devops-1100-hydra-eval-catch-errors branch from cecb106 to 51ee77a Compare October 18, 2018 12:51
@disassembler disassembler force-pushed the devops-1100-hydra-eval-catch-errors branch from 51ee77a to 2a7fa1c Compare October 18, 2018 14:40
@disassembler disassembler merged commit 43bf286 into develop Oct 18, 2018
@disassembler disassembler deleted the devops-1100-hydra-eval-catch-errors branch October 18, 2018 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants