Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TelegramSam authored Oct 9, 2024
2 parents 719b059 + d3a4a62 commit 0969a60
Show file tree
Hide file tree
Showing 129 changed files with 2,494 additions and 943 deletions.
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# For details on how this file works refer to:
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Maintain dependencies for GitHub Actions
# - Check for updates once a week
# - Group all updates into a single PR
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
all-actions:
patterns: [ "*" ]

# Maintain dependencies for Python Packages
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "Canada/Pacific"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

# Maintain dependencies for Python Packages
- package-ecosystem: "pip"
directory: "/.circleci"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "Canada/Pacific"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

31 changes: 0 additions & 31 deletions .github/workflows/indexgenerate.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: publish-docs

on:
push:
# Publish `main` as latest, and when pushes are done to branches with "v-doc" prefix
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: pip install -r ./mkdocs-requirements.txt
- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy docs
run: |
python --version
# Generate the content into the docs folder
code/genSite.sh
mike deploy --push --update-aliases main latest
mike set-default latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
*.pyc
*.tmp
.pytest_cache
docs
6 changes: 3 additions & 3 deletions 0000-template-protocol.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aries RFC 0000: Your Protocol 0.9

- Authors: [your name](you@github-email) -- email is optional
- Authors: [your name](mailto:you@github-email) -- email is optional
- Status: [PROPOSED](/README.md#proposed)
- Since: 2019-12-26 (date you submit your PR)
- Status Note: (explanation of current status)
Expand Down Expand Up @@ -31,7 +31,7 @@ Specify the official name of the protocol and its version, e.g., "My Protocol 0.

Protocol names are often either lower_snake_case or kebob-case. The non-version components of the protocol named are matched exactly.

URI: https://didcomm.org/lets_do_lunch/<version>/<messageType>
URI: `https://didcomm.org/lets_do_lunch/<version>/<messageType>`

Message types and protocols are identified with special URIs that match certain conventions. See [Message Type and Protocol Identifier URIs](https://github.com/hyperledger/aries-rfcs/blob/main/concepts/0003-protocols/README.md#message-type-and-protocol-identifier-uris) for more details.

Expand Down Expand Up @@ -159,7 +159,7 @@ Adoption should be declared in an "Adopted" subsection of "Messages".
When adoption is specified, it should include a __minimum
adopted version__ of the adopted message type: "This protocol adopts
`ack` with version >= 1.4". All versions of the adopted message that share
the same major number should be compatible, given the [semver rules](concepts/0003-protocols/semver.md)
the same major number should be compatible, given the [semver rules](https://github.com/hyperledger/aries-rfcs/blob/main/concepts/0003-protocols/README.md#semver-rules-for-protocols)
that apply to protocols.

### Constraints
Expand Down
2 changes: 1 addition & 1 deletion 0000-template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Title (Ex. 0000: RFC Topic)
- Authors: [your name](you@github-email) -- email is optional
- Authors: [your name](mailto:you@github-email) -- email is optional
- Status: [PROPOSED](/README.md#proposed)
- Since: 2019-12-26 (date you submit your PR)
- Status Note: (explanation of current status)
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ If you are here to learn about Aries, we recommend you use the [the RFC Index](i

There are 2 types of Aries RFCs:

* RFCs that describe individual features (in the [features](./features) folder)
* RFCs that explain concepts underpinning many features (in the [concepts](./concepts) folder)
* RFCs that describe individual features (in the `./features` folder)
* RFCs that explain concepts underpinning many features (in the `./concepts` folder)

RFCs are for developers *building on* Aries. They don't provide guidance on how Aries components
implement features internally; individual Aries repos have design docs for that. Each
Expand All @@ -20,7 +20,18 @@ Aries RFC includes an "implementations" section and all RFCs with a status great

RFCs go through a standard lifecycle.

![lifecycle](lifecycle.png)
<!-- To edit this lifecycle drawing:
- Copy the URL below
- Navigate to https://www.plantuml.com/plantuml/uml/
- Paste the URL into the text area in the middle of the screen beside the "Decode URL" button.
- Click the "Decode URL" button and the editable Plantuml definition of the drawing will be in the top of the box.
- Edit the lifecycle drawing as desired.
- When complete, copy the resulting URL from the box. Note that the copied URL is missing the leading "https:".
- Replace the URL below, ensuring to add the `https:` at the beginning.
- Done!
-->

![lifecycle](https://www.plantuml.com/plantuml/png/TP1DZeCm38NtEKK6rbnXHAKUe6gNg8iKN43AJ-GOUlsIoa60mYQs_Db-UQu3AQJ9QF570nYGy_X2PKayI178uWuq8dI5L45oBilbINm9MZFdVCjlwBmBiQR7Vg0U0IoZAnXd0w6YBBwqBVWJv3sw-O1MfQefVvLdzR_J43l1gdCVk-bCSeAJJ0Uh7lPeU5CJ7SSUlX0lESUyAeytLZ3wMpdVLt1Cq-iFqvoemNQJqLy0)

#### PROPOSED
To __propose__ an RFC, [use these instructions to raise a PR](
Expand All @@ -33,13 +44,17 @@ exploring.
__Demonstrated__ RFCs have one or more implementations available, listed in the "Implementations" section of the RFC document. As with the PROPOSED status, demonstrated RFCs haven't been endorsed by the community, but the ideas put forth have been more thoroughly explored through the implementation(s). The demonstrated status is an optional step in the lifecycle. For protocol-related RFCs, work on protocol tests SHOULD begin in the [test suite repo](https://github.com/hyperledger/aries-protocol-test-suite) by the time this status is assigned.

#### ACCEPTED
To get an RFC __accepted__, [build consensus](contributing.md#how-to-get-an-RFC-accepted) for your RFC on [chat](https://chat.hyperledger.org/channel/aries) and in community meetings. If your RFC is a feature that's protocol- or decorator-related, it MUST have reasonable tests in the [test suite repo](https://github.com/hyperledger/aries-protocol-test-suite), it MUST list the test suite in the protocol RFC's [Implementations section](../0000-template.md#implementations), at least one other implementation must have passed the relevant portions of the test suite, and all implementations listed in this section of the RFC MUST hyperlink to their test results. An accepted RFC is incubating on a standards track; the community has decided to polish it and is exploring or pursuing implementation.
To get an RFC __accepted__, [build consensus](contributing.md#how-to-get-an-RFC-accepted) for your RFC on [chat](https://chat.hyperledger.org/channel/aries) and in community meetings. If your RFC is a feature that's protocol- or decorator-related, it MUST have reasonable tests in the [test suite repo](https://github.com/hyperledger/aries-agent-test-harness), it MUST list the test suite in the protocol RFC's [Implementations section](/0000-template.md#implementations), at least one other implementation must have passed the relevant portions of the test suite, and all implementations listed in this section of the RFC MUST hyperlink to their test results. An accepted RFC is incubating on a standards track; the community has decided to polish it and is exploring or pursuing implementation.

#### ADOPTED
To get an RFC __adopted__, [socialize and implement](contributing.md#how-to-get-an-rfc-adopted). An RFC gets this status once it has significant momentum--when implementations accumulate, or when the mental model it advocates has begun to permeate our discourse. In other words, adoption is acknowledgment of a _de facto_ standard.

To __refine__ an RFC, propose changes to it through additional PRs. Typically these changes are driven by experience that accumulates during or after adoption. Minor refinements that just improve clarity can happen inline with lightweight review. Status is still ADOPTED.

#### STALLED
An RFC is __stalled__ when a [proposed](#proposed) RFC makes
no progress towards implementation such that it is extremely unlikely it will ever move forward. The __stalled__ state differs from [retired](#retired) in that it is an RFC that has never been implemented or superseded. Like the [retired](#retired) state, it is (likely) an end state and the RFC will not proceed further. Such an RFC remains in the repository on the off chance it will ring a chord with others, be returned to the [proposed](#proposed) state, and continue to evolve.

#### RETIRED
An RFC is __retired__ when it is withdrawn from community consideration by its authors, when implementation seems permanently stalled, or when significant refinements require a superseding document. If a retired RFC has been superseded, its `Superseded By` field should contain a link to the newer spec, and the newer spec's `Supersedes` field should contain a link to the older spec. Permalinks are not broken.

Expand Down
9 changes: 6 additions & 3 deletions code/aipUpdates.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
parser.add_argument('--version', '-v', help='The AIP version to display. Defaults to the current version(s) in the local file')
parser.add_argument('--diffs', '-d', dest='diffs', action='store_true',
help='Display the diffs of any updated RFCs found')
parser.add_argument('--list', '-l', help='List the RFCs and commits in the AIP with a prefixed by the name of a (for example) shell script')

# parse the arguments
args = parser.parse_args()
Expand Down Expand Up @@ -64,10 +65,10 @@ def readAIP( aip_path, version ):
if aip_version:
# Check if we want all the AIPs in the file or this one
if ( not(args.version) or aip_version.group(1) == args.version ):
print("Aries Interop Profile: %s" % (aip_version.group(1)))
print("# Aries Interop Profile: %s" % (aip_version.group(1)))
ListVersionRFCs = True
else:
# Not this one...don't list the changed verion
# Not this one...don't list the changed version
ListVersionRFCs = False

rfc = re.search(_aip_commit_and_file, line)
Expand All @@ -78,7 +79,9 @@ def readAIP( aip_path, version ):
protocol = rfc.group(5)
changed = re.search(protocol, subprocess.run(['git', 'diff', '--name-only', commit, 'main'], stdout=subprocess.PIPE).stdout.decode('utf-8'))
# Has this RFC changed since it was set in the RFC?
if changed:
if args.list:
print('%s %s %s' % (args.list, protocol, commit))
elif changed:
# Yes - list it.
print('>>>>>>>> Changed protocol: %s, latest commit to protocol: %s' % (protocol,
subprocess.run(['git', 'log', '-n', '1', '--pretty=format:%H', '--', protocol], stdout=subprocess.PIPE).stdout.decode('utf-8')))
Expand Down
19 changes: 19 additions & 0 deletions code/cpAIPs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash

# Usage: Given an RFC name and a commit, retrieve all the files of the RFC into the AIP RFC at the right commit.
# Example: code/cpAIP.sh concepts/0003-protocols c3b0e2120ad24810598375663b6922b980f85d00
# Designed to fetch files in subdirectories, although it is not clear how to add them to the documentatioon

PROTOCOL=$1
COMMIT=$2
AIP2=aip2

# echo Getting AIP docs for RFC $PROTOCOL, Commit $COMMIT
cd docs
for i in $(find $PROTOCOL -type f); do
AIPFile=$(echo $i | sed -r "s#(features|concepts)/#${AIP2}/#")
# echo $i $AIPFile
mkdir -p $(dirname $AIPFile)
curl -s https://raw.githubusercontent.com/hyperledger/aries-rfcs/${COMMIT}/$i -o $AIPFile
done
cd ..
75 changes: 75 additions & 0 deletions code/genSite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

# echo Updating the Docs for Aries RFCs

# Clean out the docs folder
rm -rf docs/*
mkdir -p docs

# Root folder -- README.md
cp -r contributing.md github-issues.md MAINTAINERS.md README.md SECURITY.md tags.md 0000*.md *.png collateral docs
cp LICENSE docs/LICENSE.md
sed -e "s#/tags.md#tags.md#g" index.md > docs/RFCindex.md

# Features and Concept -- collect all of the RFCs
cp -r features concepts docs

# Update the index.md file
python code/generate_index.py

# Make a copy of AIP 2 RFCs using the right commit for each
python code/aipUpdates.py -v 2.0 -l "./code/cpAIPs.sh" | \
sed -e "/0317-please-ack/d" -e "/0587-encryption-envelope-v2/d" -e "/0627-static-peer-dids/d" \
> copy_aip.sh
source copy_aip.sh
rm copy_aip.sh

# Cleanup a few things in README, contributing and 0000-templates
for i in docs/contributing.md docs/README.md docs/0000*.md; do
sed \
-e 's#../../##g' \
-e 's#index.md#RFCindex.md#' \
-e 's#LICENSE)#LICENSE.md)#' \
$i >$i.tmp
mv $i.tmp $i
done


# Cleanup missing mailtos -- will always be needed for aip2 folder, but will be cleaned up in files
for i in docs/features/*/README.md docs/concepts/*/README.md docs/aip2/*/README.md; do
sed -e '/Authors/s#](#](mailto:#g' -e 's#mailto:mailto:#mailto:#g' $i >$i.tmp; mv $i.tmp $i
done

# Cleanup the links in the RFCs
for i in docs/features/*/README.md docs/concepts/*/README.md docs/aip2/*/README.md; do
sed \
-e 's#(/#(../../#g' \
-e 's#index.md#RFCindex.md#' \
-e 's#[\./]*\(concepts\)#../../\1#g' \
-e 's#[\./]*\(features\)#../../\1#g' \
-e 's#discover-../../#discover-#g' \
$i >$i.tmp
mv $i.tmp $i
done

# Remove the existing AIP and By Status Links -- we'll add them back
MKDOCS=mkdocs.yml
MKDOCSTMP=${MKDOCS}.tmp
MKDOCSIDX=mkdocs_index.yml

# Strip off the old navigation
sed '/RFCs by AIP and Status/,$d' ${MKDOCS} >${MKDOCSTMP}

# Add back in the marker
echo '# RFCs by AIP and Status' >>${MKDOCSTMP}

# Navigation for AIP 2.0 files
echo "- AIP 2.0:" >>${MKDOCSTMP}
for i in docs/aip2/*/README.md ; do head -n 1 $i | sed -e "s/# / - /" -e "s/: / /" -e "s#\$#: $i#" -e "s#docs/##"; done >>${MKDOCSTMP}

# Navigation for all RFCs by Status
python code/generate_mkdocs_index.py
cat ${MKDOCSIDX} >>${MKDOCSTMP}
rm ${MKDOCSIDX}

mv ${MKDOCSTMP} ${MKDOCS}
46 changes: 46 additions & 0 deletions code/generate_mkdocs_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import argparse
from operator import itemgetter
import os
from pathlib import Path
import sys

import rfcs

def update(fname, tmp_fname):
if not os.path.exists(fname):
os.rename(tmp_fname, fname)
# print('Generated %s.' % fname)
return
with open(fname, encoding='utf-8', mode='rt') as f:
old = f.read()
with open(tmp_fname, encoding='utf-8', mode='rt') as f:
new = f.read()
if old == new:
# print('No change to %s.' % fname)
return
os.remove(fname)
os.rename(tmp_fname, fname)
# print('Updated %s.' % fname)


def main(fname = None):
if not fname:
fname = os.path.join(rfcs.root_folder, 'mkdocs_index.yml')
# Load all metadata
all = [rfc for rfc in rfcs.walk()]
all.sort(key=lambda x: x.num)
tmp_fname = fname + '.tmp'
with open(tmp_fname, 'w', encoding='utf-8') as out:
for status in rfcs.status_list:
out.write(f"- {status}:\n")
with_status = [rfc for rfc in all if rfc.status == status]
for rfc in with_status:
out.write(f" - {rfc.num} {rfc.title}: {rfc.relpath}\n")
update(fname, tmp_fname)


if __name__ == '__main__':
ap = argparse.ArgumentParser('Generate index')
ap.add_argument('altpath', metavar='PATH', nargs='?', default=None, help='override where index is generated')
args = ap.parse_args()
main(args.altpath)
2 changes: 1 addition & 1 deletion code/rfcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
' status_note start_date supersedes superseded_by tags content_idx impl_count impl_table')


status_list = ["ADOPTED", "ACCEPTED", "DEMONSTRATED", "PROPOSED", "RETIRED"]
status_list = ["ADOPTED", "ACCEPTED", "DEMONSTRATED", "PROPOSED", "STALLED", "RETIRED"]


root_folder = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
Expand Down
Binary file added collateral/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions concepts/0003-protocols/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aries RFC 0003: Protocols

- Authors: [Daniel Hardman](daniel.hardman@gmail.com)
- Status: [ACCEPTED](/README.md#accepted)
- Authors: [Daniel Hardman](mailto:daniel.hardman@gmail.com)
- Status: [ADOPTED](/README.md#adopted)
- Since: 2019-04-01
- Status Note: standards track and beginning to influence many mental models, but not yet [ADOPTED](/README.md#rfc-lifecycle).
- Supersedes: [Indy PR #69]( https://github.com/hyperledger/indy-hipe/pull/69)
Expand Down
Loading

0 comments on commit 0969a60

Please sign in to comment.