From 7c92f4fc7f3d830f7f081125afe9bc94cfc547ec Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Wed, 6 May 2020 16:38:00 +1000 Subject: [PATCH 1/3] Reduce logging from network layer - Set network tip log level to debug - Improve formatting of text log message - Only log the tip when it changes, because the node can seem to send updates when nothing changes --- lib/byron/src/Cardano/Wallet/Byron/Network.hs | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/byron/src/Cardano/Wallet/Byron/Network.hs b/lib/byron/src/Cardano/Wallet/Byron/Network.hs index 51471565a95..820a1c4e338 100644 --- a/lib/byron/src/Cardano/Wallet/Byron/Network.hs +++ b/lib/byron/src/Cardano/Wallet/Byron/Network.hs @@ -40,6 +40,7 @@ import Cardano.Chain.Byron.API ( ApplyMempoolPayloadErr (..) ) import Cardano.Wallet.Byron.Compatibility ( Byron + , fromByronHash , fromChainHash , fromSlotNo , fromTip @@ -147,7 +148,8 @@ import Ouroboros.Consensus.Byron.Node import Ouroboros.Consensus.Node.Run ( RunNode (..) ) import Ouroboros.Network.Block - ( Point (..) + ( BlockNo (..) + , Point (..) , SlotNo (..) , Tip (..) , blockPoint @@ -481,11 +483,6 @@ mkTipSyncClient tr bp localTxSubmissionQ onTipUpdate onTxParamsUpdate = do onTxParamsUpdate txParams let - onTipUpdate' tip = do - traceWith tr $ MsgNodeTip tip - onTipUpdate tip - queryLocalState (getTipPoint tip) - queryLocalState pt = (localStateQueryQ `send` CmdQueryLocalState pt) >>= handleLocalState @@ -497,6 +494,11 @@ mkTipSyncClient tr bp localTxSubmissionQ onTipUpdate onTxParamsUpdate = do Right (Right ls) -> onTxParamsUpdate' $ txParametersFromUpdateState ls + onTipUpdate' <- debounce $ \tip -> do + traceWith tr $ MsgNodeTip tip + onTipUpdate tip + queryLocalState (getTipPoint tip) + pure $ nodeToClientProtocols NodeToClientProtocols { localChainSyncProtocol = InitiatorProtocolOnly $ MuxPeerRaw $ \channel -> @@ -1057,9 +1059,13 @@ instance ToText NetworkLayerLog where ] MsgLocalStateQuery msg -> T.pack (show msg) - MsgNodeTip tip -> T.unwords - [ "Network node tip is:" - , T.pack (show tip) + MsgNodeTip TipGenesis -> + "Network node tip is at genesis" + MsgNodeTip (Tip _sl h (BlockNo bl)) -> T.unwords + [ "Network node tip block height is" + , T.pack (show bl) + , "at hash" + , pretty (fromByronHash h) ] MsgTxParameters params -> T.unwords [ "TxParams for tip are:" @@ -1084,6 +1090,6 @@ instance HasSeverityAnnotation NetworkLayerLog where MsgIntersectionFound{} -> Info MsgPostSealedTx{} -> Debug MsgLocalStateQuery{} -> Debug - MsgNodeTip{} -> Info + MsgNodeTip{} -> Debug MsgTxParameters{} -> Info MsgLocalStateQueryError{} -> Error From f80a35b7e53477345b202ceaab5d41c9dfb8f63f Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Wed, 6 May 2020 16:58:04 +1000 Subject: [PATCH 2/3] Prevent bors from merging into any branch except master --- .buildkite/pipeline.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index eb58de01c18..ff9b6c9578d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -57,3 +57,13 @@ steps: system: x86_64-linux soft_fail: - exit_status: '*' + + - label: 'Prevent merging to wrong branch' + if: 'build.branch == "bors/staging" && build.pull_request.base_branch != "master"' + command: + - 'echo "Refusing to merge into $BUILDKITE_PULL_REQUEST_BASE_BRANCH."' + - 'echo "You should only use bors to merge into master."' + - 'echo "Either change the PR base branch to master, or merge manually."' + - 'exit 1' + agents: + system: x86_64-linux From 70a8f7ec147f37362211f2d246ab8bad7b48ae80 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Wed, 6 May 2020 15:28:58 +0200 Subject: [PATCH 3/3] review RELEASE_TEMPLATE to constuct changelog from PR + labels We used to organize the CHANGELOG by milestones, but we are now organizing it by 'type of change' (improvement, bug fix, addition). Therefore, the current thing called CHANGELOG is redundant with the other. I've tweaked the 'make_changelog' script to build a changelog according to these categories, provided that PR were labelled accordingly. --- .github/RELEASE_TEMPLATE.md | 30 +++++++++--------------------- scripts/make_changelog | 32 +++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/RELEASE_TEMPLATE.md b/.github/RELEASE_TEMPLATE.md index cc86d9773fa..51f2c2b298c 100644 --- a/.github/RELEASE_TEMPLATE.md +++ b/.github/RELEASE_TEMPLATE.md @@ -2,32 +2,20 @@ Compatible with [`jormungandr@{{JORM_TAG}}`](https://github.com/input-output-hk/jormungandr/releases/tag/{{JORM_TAG}}) and [`cardano-node@{{CARDANO_NODE_TAG}}`](https://github.com/input-output-hk/cardano-node/releases/tag/{{CARDANO_NODE_TAG}}). + -## Improvements - -## Resolved Issues - - +{{CHANGELOG}} ## Known Issues -## Changelog - - - - -{{CHANGELOG}} - - -## Weekly Reports - -- [Week 12 - 2020-03-20](https://github.com/input-output-hk/cardano-wallet/tree/weekly-reports/2020-03-20) - ## Documentation @@ -57,7 +45,7 @@ the moment of releasing. --> #### Docker -Pull from DockerHub and verify version. +Pull from DockerHub and verify the version matches {{CABAL_VERSION}} ``` $ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}-jormungandr @@ -76,7 +64,7 @@ $ docker run --rm inputoutput/cardano-wallet:{{CABAL_VERSION}}-jormungandr versi #### Docker -Pull from DockerHub and verify version. +Pull from DockerHub and verify the version matches {{CABAL_VERSION}}. ``` $ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}-byron diff --git a/scripts/make_changelog b/scripts/make_changelog index 2ce478c220c..193049434fa 100755 --- a/scripts/make_changelog +++ b/scripts/make_changelog @@ -18,26 +18,36 @@ REPO="input-output-hk/cardano-wallet" : ${GITHUB_API_TOKEN?"Please provide a Github Api Token for fetching pull requests"} PULL_REQUESTS=$(curl -X GET \ - -H "Authorization: token $GITHUB_API_TOKEN" \ + -H "Authorization: token $API_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/search/issues?per_page=500\&q=repo:$REPO+is:pr+is:merged+merged:%3E$1) -PULL_REQUESTS=$(echo $PULL_REQUESTS | jq '.items | map({number:.number,title:.title,milestone:.milestone.title}) | group_by(.milestone)') +PULL_REQUESTS=$(echo $PULL_REQUESTS | jq '.items | map({number:.number,title:.title,label:.labels[0].name}) | group_by(.label)') ITEMS=$(echo $PULL_REQUESTS | jq 'map(map("#\(.number) | \(.title)"))') -MILESTONES=$(echo $PULL_REQUESTS | jq 'map(map("\(.milestone)") | unique) | flatten') -I=($(echo $MILESTONES | jq 'length - 1')) +LABELS=$(echo $PULL_REQUESTS | jq 'map(map("\(.label)") | unique) | flatten') +I=($(echo $LABELS | jq 'length - 1')) for i in $(seq 0 $I); do - MILESTONE=$(echo $MILESTONES | jq -r ".[$i]") - echo "
" - echo " $MILESTONE" + LABEL=$(echo $LABELS | jq -r ".[$i]") + case $LABEL in + "null") + echo "## Unclassified" + ;; + "ADDING FEATURE") + echo "## New Features" + ;; + "IMPROVING CODE") + echo "## Improvements" + ;; + "RESOLVING ISSUE") + echo "## Resolved Issues" + ;; + esac echo "" - echo "PR | Description" - echo "-- | --" J=($(echo $ITEMS | jq ".[$i] | length - 1")) for j in $(seq 0 $J); do LINE=$(echo $ITEMS | jq -r ".[$i] | .[$j]") - echo "$LINE" + echo "- $LINE" done - echo "
" + echo "" done