Skip to content

Commit f631ef1

Browse files
authored
Merge pull request #41 from IntersectMBO/coot/haddocks
Haddocks, docs & release scripts
2 parents 6a55c52 + 3b25133 commit f631ef1

5 files changed

Lines changed: 36 additions & 30 deletions

File tree

.github/workflows/github-page.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ jobs:
3030
url: ${{ steps.deployment.outputs.page_url }}
3131

3232
steps:
33+
- name: Install pandoc
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y pandoc
37+
3338
- name: Checkout dmq-node repository
3439
uses: actions/checkout@v6
3540

41+
- name: Prologue
42+
run: pandoc -f markdown -t haddock README.md -o README.haddock
43+
3644
# we need nix to later build the spec documents
3745
- name: Install Nix
3846
uses: cachix/install-nix-action@v31
@@ -70,7 +78,7 @@ jobs:
7078

7179
- name: Build documents
7280
run: |
73-
cabal haddock-project --hackage all
81+
cabal haddock-project --prologue=./README.haddock --hackage all
7482
7583
- name: Upload artifacts
7684
uses: actions/upload-pages-artifact@v4

CONTRIBUTING.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,11 @@ is very helpful to diagnose build time compiler errors.
8989
Any contributions should be well documented. APIs should have well-written
9090
`haddocks`. If a particular function expects a precondition to be satisfied it
9191
should be explicitly mentioned. The inline documentation is published at
92-
93-
-- TODO link
94-
95-
<https://ouroboros-network.cardano.intersectmbo.org>. When writing haddocks
96-
it's always good to put oneself in the position of somebody who hasn't yet
92+
<https://dmq-node.cardano.intersectmbo.org>. When writing haddocks it's always
93+
good to put oneself in the position of somebody who hasn't yet
9794
interacted with your code changes. It's good to explain the key design choices
9895
as well as implementation-level comments.
9996

100-
If changes would modify any existing design the contributor might be expected
101-
to be asked to also update the standalone documentation (written in `tex`).
102-
10397
## Changelogs
10498

10599
We maintain changelogs for all our packages.
@@ -139,7 +133,7 @@ The last command should fail with an error that the current revision is not on
139133
the `master` or a `release/*` branch. After running both commands, you will
140134
need to delete branch created in `cardano-haskell-packages`.
141135

142-
### Release from master or release/* branch
136+
### Release from main or release/* branch
143137

144138
* First run `./script/release-to-chap.sh -r` to see which changes can be
145139
published.

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[![x86\_64-linux](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-dmq-node/main/x86_64-linux.required/shield&style=for-the-badge&label=x86_64-linux)](https://ci.iog.io/job/IntersectMBO-dmq-node/main/x86_64-linux.required)
2+
[![x86\_64-darwin](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-dmq-node/main/x86_64-darwin.required/shield&style=for-the-badge&label=x86_64-darwin)](https://ci.iog.io/job/IntersectMBO-dmq-node/main/x86_64-darwin.required)
3+
[![aarch64-darwin](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-dmq-node/main/aarch64-darwin.required/shield&style=for-the-badge&label=aarch64-linux)](https://ci.iog.io/job/IntersectMBO-dmq-node/main/aarch64-darwin.required)
4+
[![mingw64](https://img.shields.io/github/actions/workflow/status/intersectmbo/dmq-node/build.yml?branch=main&label=mingw64&style=for-the-badge)](https://github.com/intersectmbo/dmq-node/actions/workflows/build.yml)
5+
[![Haddocks](https://img.shields.io/github/actions/workflow/status/intersectmbo/dmq-node/github-page.yml?branch=main&label=Haddocks&style=for-the-badge)](https://dmq-node.cardano.intersectmbo.org/)
6+
[![Discord](https://img.shields.io/discord/1136727663583698984?style=for-the-badge&color=blue)](https://discord.com/channels/1136727663583698984/1239889324745429122)
7+
18
# Decentralized Message Queue
29

310
The DMQ node allows for client peers to communicate efficiently by publishing
@@ -6,19 +13,12 @@ and consuming messages which are diffused over a P2P network to other nodes.
613
This repository provides the `dmq-node` executable to participate in the DMQ
714
network.
815

9-
The `dmq-node` is developed with respect to the [CIP#0137].
16+
The `dmq-node` is developed with respect to the [CIP#137].
1017

1118
__NOTE__: This is still an early version of DMQ node, which comes with some
1219
quirks:
1320

14-
* issue#6 - no support for ledger peers, which requires setting up static peers
15-
using local roots. We are aiming to add this feature for the
16-
`cardano-node-10.7` release.
17-
* issue#13 - using `TxSubmission` mini-protocol for which roles are swapped,
18-
e.g. server requests data, client servers the data. This makes
19-
configuration awekward, since your local roots specify who will get data from
20-
you, rather than who you get data from. We are working on a new
21-
mini-protocol to address this.
21+
* [issue#6] - experimental support for ledger peers see [Ledger Peers](#ledger-peers) below.
2222

2323
# Instructions
2424

@@ -115,7 +115,7 @@ To use ledger peers, as `cardano-node` does there are additional requrements:
115115

116116
* You need `cardano-node-10.7` or newer to support ledger peer snapshot query
117117
over `cardano-node`'s node-to-client protocol.
118-
* You need to configure `cardano-node` & `dmq-node` to use SRV records according to [CIP#0155]
118+
* You need to configure `cardano-node` & `dmq-node` to use SRV records according to [CIP#155]
119119
* You need to set `LedgerPeers: true` in the configuration file.
120120

121121
Currently ledger peers are disabled by default, but in a near future we will
@@ -133,7 +133,7 @@ To enter a development shell with all dependencies available, use:
133133
To run the test suite, one can use:
134134

135135
``` bash
136-
> cabal test all
136+
> cabal run dmq-node:dmq-tests
137137
```
138138

139139
### CDDL
@@ -158,7 +158,8 @@ The code of conduct is available [here][code-of-conduct].
158158
[code-of-conduct]: ./CODE_OF_CONDUCT.md
159159
[style-guide]: https://github.com/IntersectMBO/ouroboros-network/blob/main/docs/StyleGuide.md
160160
[musl]: https://musl.libc.org/
161-
[CIP#0137]: https://cips.cardano.org/cip/CIP-0137
162-
[CIP#0155]: https://cips.cardano.org/cip/CIP-0155
161+
[CIP#137]: https://cips.cardano.org/cip/CIP-0137
162+
[CIP#155]: https://cips.cardano.org/cip/CIP-0155
163163
[topology-file]: https://developers.cardano.org/docs/get-started/infrastructure/node/topology/
164164
[defaultConfiguration]: http://intersectmbo.github.io/dmq-node/dmq-node/src/DMQ.Configuration.html#defaultConfiguration
165+
[issue#6]: https://github.com/intersectMBO/dmq-node/issues/6

scripts/build-with-chap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ fi
4545
cabal_files=$(fd -ae 'cabal')
4646
for cf in $cabal_files; do
4747
name=$(cat $cf | grep '^name:' | awk '{ print $2 }')
48-
if [[ -d "$CHAP_DIR/_sources/$name" ]]; then
49-
version=$(ls -1 $CHAP_DIR/_sources/$name | sort -V | tail -1)
48+
version=$(cat $cf | grep '^version:' | awk '{ print $2 }')
49+
if [[ -d "$CHAP_DIR/_sources/$name/$version" ]]; then
5050
rev=$(yq .github.rev $CHAP_DIR/_sources/$name/$version/meta.toml)
5151
git restore --source=$rev -- $name
5252
tb=0
@@ -57,7 +57,7 @@ for cf in $cabal_files; do
5757
cp $revdir/$rev "$name/$name.cabal"
5858
fi
5959
else
60-
echo "WARNING: $name not in cardano-haskell-packages"
60+
echo "WARNING: $name-$version not in cardano-haskell-packages"
6161
fi
6262
done
6363

@@ -82,5 +82,5 @@ fi
8282

8383
pushd $CHAP_DIR
8484
if [[ $TEST == 0 && $(git symbolic-ref --short HEAD) =~ ^dmq-node\/release- ]] then
85-
gh pr comment --body "* [x] checked with \`build-with-chap.sh\` in \`dmq-network\`"
85+
gh pr comment --body "* [x] checked with \`build-with-chap.sh\` in \`dmq-node\`"
8686
fi

scripts/release-to-chap.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,27 @@ else
8181
git switch main
8282
git pull
8383
fi
84-
BRANCH="dmq-node/release-$(date -I)"
84+
BRANCH="dmq-node/release-$(date +%Y%m%d-%H%M%S)"
8585
if [[ $TEST == 1 ]];then
8686
BRANCH="${BRANCH}-DO_NOT_MERGE"
8787
fi
8888
git switch -c $BRANCH
8989

90+
# Gather packages to publish on CHaP
91+
publish=""
9092
for cf in $cabal_files; do
9193
name=$(cat $cf | grep '^name:' | awk '{ print $2 }')
9294
version=$(cat $cf | grep '^version:' | awk '{ print $2 }')
9395
dir="$CHAP_DIR/_sources/$name/$version"
9496
if [[ !(-d $dir) ]];then
95-
trace "publishing $name-$version"
96-
./scripts/add-from-github.sh $REPO_URL $gitsha $name
97+
publish="$publish $name"
9798
if [[ $TEST == 0 ]];then
9899
git --git-dir "$gitdir/.git" tag "$name-$version" $gitsha
99100
fi
100101
fi
101102
done
103+
trace "Publishing:$publish"
104+
./scripts/add-from-github.sh $REPO_URL $gitsha $publish
102105

103106
git --no-pager log --oneline origin/main..HEAD
104107

0 commit comments

Comments
 (0)