Skip to content

Commit 69b7515

Browse files
Merge branch 'main' into delete-tail-files
2 parents 50e6a3e + 467104f commit 69b7515

89 files changed

Lines changed: 602 additions & 435 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-indy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish ACA-Py Image (Indy)
22
run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image (Indy ${{ inputs.indy_version || '1.16.0' }})
33
on:
44
release:
5-
types: [released]
5+
types: [published]
66

77
workflow_dispatch:
88
inputs:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish ACA-Py Image
22
run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image
33
on:
44
release:
5-
types: [released]
5+
types: [published]
66

77
workflow_dispatch:
88
inputs:

CHANGELOG.md

Lines changed: 183 additions & 88 deletions
Large diffs are not rendered by default.

PUBLISHING.md

Lines changed: 104 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,116 @@ Once ready to do a release, create a local branch that includes the following up
1212

1313
3. Include details of the merged PRs included in this release. General process to follow:
1414

15-
- Gather the set of PRs since the last release and put them into a list. A good tool to use for this is the [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator). Steps:
16-
- Create a read only GitHub token for your account on this page: [https://github.com/settings/tokens](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token) with a scope of `repo` / `public_repo`.
17-
- Use a command like the following, adjusting the tag parameters as appropriate. `docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator --user hyperledger --project aries-cloudagent-python --output 0.7.4-rc0.md --since-tag 0.7.3 --future-release 0.7.4-rc0 --release-branch main --token <your-token>`
18-
- In the generated file, use only the PR list -- we don't include the list of closed issues in the Change Log.
15+
- Gather the set of PRs since the last release and put them into a list. A good
16+
tool to use for this is the
17+
[github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator).
18+
Steps:
19+
- Create a read only GitHub token for your account on this page:
20+
[https://github.com/settings/tokens](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token)
21+
with a scope of `repo` / `public_repo`.
22+
- Use a command like the following, adjusting the tag parameters as
23+
appropriate. `docker run -it --rm -v "$(pwd)":/usr/local/src/your-app
24+
githubchangeloggenerator/github-changelog-generator --user hyperledger
25+
--project aries-cloudagent-python --output 0.7.4-rc0.md --since-tag 0.7.3
26+
--future-release 0.7.4-rc0 --release-branch main --token <your-token>`
27+
- In the generated file, use only the PR list -- we don't include the list of
28+
closed issues in the Change Log.
29+
30+
In some cases, the approach above fails because of too many API calls. An
31+
alternate approach to getting the list of PRs in the right format is to use this
32+
scary `sed` pipeline process to get the same output.¥
33+
34+
- Put the following commands into a file called `changelog.sed`
35+
36+
``` bash
37+
/Approved/d
38+
/updated /d
39+
/^$/d
40+
/^ [0-9]/d
41+
s/was merged.*//
42+
/^@/d
43+
s# by \(.*\) # [\1](https://github.com/\1)#
44+
s/^ //
45+
s# \#\([0-9]*\)# [\#\1](https://github.com/hyperledger/aries-cloudagent-python/pull/\1) #
46+
s/ / /g
47+
/^Version/d
48+
/tasks done/d
49+
s/^/- /
50+
```
51+
52+
- Navigate in your browser to the paged list of PRs merged since the last
53+
release (using in the GitHub UI a filter such as `is:pr is:merged sort:updated
54+
merged:>2022-04-07`) and for each page, highlight, and copy the text
55+
of only the list of PRs on the page to use in the following step.
56+
- For each page, run the command `sed -e :a -e '$!N;s/\n#/ #/;ta' -e 'P;D' <<EOF
57+
| sed -f changelog.sed`, paste in the copied text and then type `EOF`.
58+
Redirect the output to a file, appending each page of output to the file.
59+
- The first `sed` command in the pipeline merges the PR title and PR number
60+
plus author lines onto a single line. The commands in the `changelog.sed`
61+
file just clean up the data, removing unwanted lines, etc.
62+
- At the end of that process, you should have a list of all of the PRs in a form you can
63+
use in the CHANGELOG.md file.
64+
- To verify you have right contents, you can do a `wc` of the file and there
65+
should be one line per PR. You should scan the file as well, looking for
66+
anomalies. It's a pretty ugly process.
67+
- Using a `curl` command and the GitHub API is probably a much better and more
68+
robust way to do this, but this was quick and dirty...
69+
70+
Once you have the list of PRs:
71+
1972
- Organize the list into suitable categories, update (if necessary) the PR description and add notes to clarify the changes. See previous release entries to understand the style -- a format should help developers.
2073
- Add a narrative about the release above the PR that highlights what has gone into the release.
2174

22-
4. Update the ReadTheDocs in the `/docs` folder by following the instructions in the `docs/README.md` file. That will likely add a number of new and modified files to the PR. Eliminate all of the errors in the generation process, either by mocking external dependencies or by fixing ACA-Py code. If necessary, create an issue with the errors and assign it to the appropriate developer. Experience has demonstrated to use that documentation generation errors should be fixed in the code.
75+
4. Update the ReadTheDocs in the `/docs` folder by following the instructions in
76+
the `docs/README.md` file. That will likely add a number of new and modified
77+
files to the PR. Eliminate all of the errors in the generation process,
78+
either by mocking external dependencies or by fixing ACA-Py code. If
79+
necessary, create an issue with the errors and assign it to the appropriate
80+
developer. Experience has demonstrated to use that documentation generation
81+
errors should be fixed in the code.
2382

24-
5. Update the version number listed in [aries_cloudagent/version.py](aries_cloudagent/version.py) and, prefixed with a "v" in [open-api/openapi.json](open-api/openapi.json) (e.g. "0.7.2" in the version.py file and "v0.7.2" in the openapi.json file). The incremented version number should adhere to the [Semantic Versioning Specification](https://semver.org/#semantic-versioning-specification-semver) based on the changes since the last published release. For Release Candidates, the form of the tag is "0.7.2-rc0".
83+
5. Update the version number listed in
84+
[aries_cloudagent/version.py](aries_cloudagent/version.py) and, prefixed with
85+
a "v" in [open-api/openapi.json](open-api/openapi.json) (e.g. "0.7.2" in the
86+
version.py file and "v0.7.2" in the openapi.json file). The incremented
87+
version number should adhere to the [Semantic Versioning
88+
Specification](https://semver.org/#semantic-versioning-specification-semver)
89+
based on the changes since the last published release. For Release
90+
Candidates, the form of the tag is "0.7.2-rc0".
2591

26-
6. An extra search of the repo for the existing tag is recommended to see if there are any other instances of the tag in the repo. If any are found to be required (other than in CHANGELOG.md and the examples in this file, of course), finding a way to not need them is best, but if they are needed, please update this document to note where the tag can be found.
92+
6. An extra search of the repo for the existing tag is recommended to see if
93+
there are any other instances of the tag in the repo. If any are found to be
94+
required (other than in CHANGELOG.md and the examples in this file, of
95+
course), finding a way to not need them is best, but if they are needed,
96+
please update this document to note where the tag can be found.
97+
98+
7. Double check all of these steps above, and then submit a PR from the branch.
99+
If there are still further changes to be merged, mark the PR as "Draft",
100+
repeat **ALL** of the steps again, and then mark this PR as ready and then
101+
wait until it is merged.
102+
103+
8. Immediately after it is merged, create a new GitHub tag representing the
104+
version. The tag name and title of the release should be the same as the
105+
version in [aries_cloudagent/version.py](aries_cloudagent/version.py). Use
106+
the "Generate Release Notes" capability to get a sequential listing of the
107+
PRs in the release, to complement the manually curated Changelog. Verify on
108+
PyPi that the version is published.
27109

28-
7. Double check all of these steps above, and then submit a PR from the branch. If there are still further changes to be merged, mark the PR as "Draft", repeat **ALL** of the steps again, and then mark this PR as ready and then wait until it is merged.
110+
9. New images for the release are automatically published by the GitHubAction
111+
Workflows: [publish.yml] and [publish-indy.yml]. The actions are triggered
112+
when a release is tagged, so no manual action is needed. The images are
113+
published in the [Hyperledger Package Repository under
114+
aries-cloudagent-python](https://github.com/orgs/hyperledger/packages?repo_name=aries-cloudagent-python)
115+
and a link to the packages added to the repositories main page (under
116+
"Packages").
29117

30-
8. Immediately after it is merged, create a new GitHub tag representing the version. The tag name and title of the release should be the same as the version in [aries_cloudagent/version.py](aries_cloudagent/version.py). Use the "Generate Release Notes" capability to get a sequential listing of the PRs in the release, to complement the manually curated Changelog. Verify on PyPi that the version is published.
118+
Additional information about the container image publication process can be
119+
found in the document [Container Images and Github Actions]().
31120

32-
9. Publish a new docker container on Docker Hub ([bcgovimages/aries-cloudagent](https://hub.docker.com/r/bcgovimages/aries-cloudagent/)) by following the README.md instructions to create a PR for the release in the repository [https://github.com/bcgov/aries-cloudagent-container](https://github.com/bcgov/aries-cloudagent-container). Appropriate permissions are required to publish the image.
121+
[publish.yml]: https://github.com/hyperledger/aries-cloudagent-python/blob/main/.github/workflows/publish.yml
122+
[publish-indy.yml]: https://github.com/hyperledger/aries-cloudagent-python/blob/main/.github/workflows/publish-indy.yml
123+
[Container Images and Github Actions]: https://github.com/hyperledger/aries-cloudagent-python/blob/main/ContainerImagesAndGithubActions.md
33124

34-
10. Update the ACA-Py Read The Docs site by building the new "latest" (main branch) and activating and building the new release. Appropriate permissions are required to publish the new documentation version.
125+
10. Update the ACA-Py Read The Docs site by building the new "latest" (main
126+
branch) and activating and building the new release. Appropriate permissions
127+
are required to publish the new documentation version.

aries_cloudagent/admin/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ async def start(self) -> None:
491491

492492
def sort_dict(raw: dict) -> dict:
493493
"""Order (JSON, string keys) dict asciibetically by key, recursively."""
494-
for (k, v) in raw.items():
494+
for k, v in raw.items():
495495
if isinstance(v, dict):
496496
raw[k] = sort_dict(v)
497497
return dict(sorted([item for item in raw.items()], key=lambda x: x[0]))

aries_cloudagent/askar/didcomm/v2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def ecdh_es_encrypt(to_verkeys: Mapping[str, Key], message: bytes) -> bytes:
3333
except AskarError:
3434
raise DidcommEnvelopeError("Error creating content encryption key")
3535

36-
for (kid, recip_key) in to_verkeys.items():
36+
for kid, recip_key in to_verkeys.items():
3737
try:
3838
epk = Key.generate(recip_key.algorithm, ephemeral=True)
3939
except AskarError:
@@ -145,7 +145,7 @@ def ecdh_1pu_encrypt(
145145

146146
apu = b64url(sender_kid)
147147
apv = []
148-
for (kid, recip_key) in to_verkeys.items():
148+
for kid, recip_key in to_verkeys.items():
149149
if agree_alg:
150150
if agree_alg != recip_key.algorithm:
151151
raise DidcommEnvelopeError("Recipient key types must be consistent")
@@ -173,7 +173,7 @@ def ecdh_1pu_encrypt(
173173
raise DidcommEnvelopeError("Error encrypting message payload")
174174
wrapper.set_payload(payload.ciphertext, payload.nonce, payload.tag)
175175

176-
for (kid, recip_key) in to_verkeys.items():
176+
for kid, recip_key in to_verkeys.items():
177177
enc_key = ecdh.Ecdh1PU(alg_id, apu, apv).sender_wrap_key(
178178
wrap_alg, epk, sender_key, recip_key, cek, cc_tag=payload.tag
179179
)

aries_cloudagent/config/tests/test_wallet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ async def test_wallet_config_bad_seed_x(self):
187187
) as mock_seed_to_did, async_mock.patch.object(
188188
test_module, "add_or_update_version_to_storage", async_mock.CoroutineMock()
189189
):
190-
191190
with self.assertRaises(test_module.ConfigError):
192191
await test_module.wallet_config(self.context, provision=True)
193192

aries_cloudagent/connections/base_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def create_did_document(
150150
routing_keys = [*routing_keys, *mediator_routing_keys]
151151
svc_endpoints = [mediation_record.endpoint]
152152

153-
for (endpoint_index, svc_endpoint) in enumerate(svc_endpoints or []):
153+
for endpoint_index, svc_endpoint in enumerate(svc_endpoints or []):
154154
endpoint_ident = "indy" if endpoint_index == 0 else f"indy{endpoint_index}"
155155
service = Service(
156156
did_info.did,

aries_cloudagent/connections/models/diddoc/diddoc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def add_service_pubkeys(
176176

177177
rv = []
178178
for tag in [tags] if isinstance(tags, str) else list(tags):
179-
180179
for svc_key in service.get(tag, {}):
181180
canon_key = canon_ref(self.did, svc_key)
182181
pubkey = None

aries_cloudagent/connections/models/diddoc/tests/test_diddoc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
class TestDIDDoc(AsyncTestCase):
2828
async def test_basic(self):
29-
3029
# One authn key by reference
3130
dd_in = {
3231
"@context": "https://w3id.org/did/v1",

0 commit comments

Comments
 (0)