Skip to content

Commit 68766ea

Browse files
authored
build docs on release (#3)
1 parent 336d973 commit 68766ea

Some content is hidden

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

80 files changed

+98
-28544
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: docs
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build_documentation:
9+
name: Generate documentation
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.7'
19+
- name: Install dependencies
20+
run: |
21+
make install
22+
make develop
23+
- name: Prep branch
24+
run: git worktree add $TMPDIR/af-gh-pages gh-pages
25+
- name: Build documentation
26+
run: |
27+
make docs DOC_TARGET=$TMPDIR/af-gh-pages
28+
- name: Commit docs
29+
run: |
30+
cd $TMPDIR/af-gh-pages
31+
git add *
32+
git commit -a -m 'Documentation update for release' --no-verify
33+
git push origin gh-pages

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
DOC_TARGET?=doc
18+
1719
develop:
1820
pip install -q -e .[dev] --upgrade --upgrade-strategy eager
1921
pre-commit install
@@ -38,4 +40,4 @@ test::
3840
docs:
3941
# Build the API docs from the source code - overwrites those files, which are ignored by git
4042
sphinx-apidoc -o doc-source compliance
41-
sphinx-build doc-source doc
43+
sphinx-build doc-source $(DOC_TARGET)

doc-source/conf.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
import os
44
import sys
55
import datetime
6-
import compliance
76

8-
sys.path.insert(
9-
0,
10-
os.path.abspath(os.path.join(os.path.dirname(__file__), '../compliance'))
11-
)
7+
new_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
8+
sys.path.insert(0, new_path)
129

13-
print(os.path.abspath(os.path.join(os.path.dirname(__file__), '../compliance')))
10+
import compliance
11+
print(new_path)
1412

1513
# -- General configuration ------------------------------------------------
1614

doc-source/credentials-example.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- mode:conf -*-
22

3-
# Token for github.ibm.com to be used by the Locker
4-
[github_enterprise]
3+
# Token for github.com to be used by the Locker
4+
[github]
55
token=XXX
66

77
# Webhook for Slack notifications

doc-source/design-principles.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ for:
6262

6363
{
6464
"locker": {
65-
"repo_url": "https://github.ibm.com/my-org/my-evidence",
65+
"repo_url": "https://github.com/my-org/my-evidence-repo",
6666
"gitconfig": {
6767
"commit": {"gpgsign": true},
6868
"gpg": {"program": "gpg2"},
6969
"user": {
7070
"signingKey": "AABBCCDD",
71-
"email": "compliance-robot@ibm.com",
71+
"email": "compliance-robot@my-org.com",
7272
"name": "compliance-robot"
7373
}
7474
}
@@ -93,7 +93,7 @@ for:
9393
9494
{
9595
"locker": {
96-
"repo_url": "https://github.ibm.com/my-org/my-evidence",
96+
"repo_url": "https://github.com/my-org/my-evidence-repo",
9797
"ttl_tolerance": 3600
9898
}
9999
}
@@ -425,15 +425,7 @@ levels:
425425
Credentials
426426
~~~~~~~~~~~
427427

428-
The compliance tool uses the `utilitarian
429-
<https://github.ibm.com/cloudant/utilitarian>`_ library for managing
430-
credentials. Fetchers and checks might need to use credentials in
431-
order to access different resources on different locations. The tool
432-
assumes that there is a file at ``~/.credentials`` and the sections and
433-
fields supported are defined by
434-
:py:class:`utilitarian.crendentials.Config`.
435-
436-
If you want to configure your credentials locally, the compliance tool
428+
If you want to configure your credentials locally, the framework
437429
will look for a credentials file at ``~/.credentials`` by default. This
438430
file should be similar to this:
439431

doc-source/evidence-partitioning.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Partitioned Evidence
66
====================
77

88
Depending on the repository hosting service being used, it may be necessary to
9-
manage evidence more effectively. For example Github Enterprise will not allow
10-
pushing files larger than 100MB. In cases like this it is possible to
11-
partition evidence into smaller, more manageable chunks if that evidence
12-
satisfies the following conditions:
9+
manage evidence more effectively. For example Github has limits on individual
10+
file sizes. In cases like this it is possible to partition evidence into
11+
smaller, more manageable chunks if that evidence satisfies the following
12+
conditions:
1313

1414
* Evidence is of the type :py:class:`~compliance.evidence.RawEvidence` or a
1515
sub-class of :py:class:`~compliance.evidence.RawEvidence`.
@@ -44,7 +44,7 @@ where the evidence will be partitioned. For example::
4444

4545
{
4646
"locker": {
47-
"repo_url": "https://github.ibm.com/my-org/my-repo",
47+
"repo_url": "https://github.com/my-org/my-evidence-repo",
4848
"partitions": {
4949
"foo/evidence_bar.json": {
5050
"fields": ["location.country", "location.region"],
@@ -58,7 +58,7 @@ or::
5858

5959
{
6060
"locker": {
61-
"repo_url": "https://github.ibm.com/my-org/my-repo",
61+
"repo_url": "https://github.com/my-org/my-evidence-repo",
6262
"partitions": {
6363
"foo/evidence_bar.json": {
6464
"fields": ["location.country", "location.region"]
@@ -120,7 +120,7 @@ Default Partition Root
120120

121121
{
122122
"locker": {
123-
"repo_url": "https://github.ibm.com/my-org/my-repo",
123+
"repo_url": "https://github.com/my-org/my-evidence-repo",
124124
"partitions": {
125125
"foo/evidence_bar.json": {
126126
"fields": ["country", "region"]
@@ -174,7 +174,7 @@ Explicit Partition Root
174174

175175
{
176176
"locker": {
177-
"repo_url": "https://github.ibm.com/my-org/my-repo",
177+
"repo_url": "https://github.com/my-org/my-evidence-repo",
178178
"partitions": {
179179
"foo/evidence_bar.json": {
180180
"fields": ["country", "region"],

doc-source/index.rst

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
.. -*- mode:rst; coding:utf-8 -*-
22
3-
compliance-tool's documentation
4-
===============================
3+
Auditree framework documentation
4+
================================
55

66
Tool to run compliance control checks as unit tests.
77

8-
`#compliance-tooling <https://ibm-cloudplatform.slack.com/messages/C3X0P7CUB>`_
9-
108
Installation
119
------------
1210

1311
For users
1412
~~~~~~~~~
1513

16-
You can use the following ``pip`` command for installing
17-
``compliance-tool`` in your environment. The URL is also suitable for
18-
``requirements.txt`` and ``setup.py`` (using ``setuptools``)::
19-
20-
$ pip install git+ssh://git@github.ibm.com/clouddataservices/compliance-tool.git#egg=compliance-tool
14+
The framework is uploaded to `pypi <https://pypi.org/project/auditree-framework/>`_.
15+
You can install it via:
2116

17+
.. code-block:: bash
2218
23-
You can specify a specific version. For example ``v0.0.1``::
24-
25-
$ pip install git+ssh://git@github.ibm.com/clouddataservices/compliance-tool.git@v0.0.1#egg=compliance-tool
19+
$ pip install auditree-framework
2620
2721
See the :ref:`quick-start` section for a brief introduction to the
2822
tool usage. Also, see :ref:`running-on-travis` section for getting
@@ -33,12 +27,11 @@ For developers
3327

3428
.. code-block:: bash
3529
36-
$ git clone git@github.ibm.com:cloumpose/compliance-tool
37-
$ cd compliance-tool
38-
$ git submodule update --init --recursive
39-
$ virtualenv --no-site-packages venv
30+
$ git clone git@github.com:ComplianceAsCode/auditree-framework.git
31+
$ cd auditree-framework
32+
$ python3 -m venv venv
4033
$ . venv/bin/activate
41-
$ make develop
34+
$ make install && make develop
4235
4336
Guides
4437
------

doc-source/notifiers.rst

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
Notifiers
66
=========
77

8-
The last phase in a typical compliance-tool check run is the notification
8+
The last phase in a typical framework check run is the notification
99
system. Multiple notifiers can be targeted as part of this phase by using
1010
the ``--notify`` option on the ``compliance --check`` command. Valid
11-
notifier options are ``stdout``, ``slack``, ``pagerduty``, ``ghe_issues`` and,
12-
``locker``. The general idea behind the notification system is that each
13-
``test_`` can generate a short notification that has the following components:
11+
notifier options are ``stdout``, ``slack``, ``pagerduty``, ``findings``,
12+
``gh_issues`` and, ``locker``. The general idea behind the notification
13+
system is that each ``test_`` can generate a short notification that has the
14+
following components:
1415

1516
* title (mandatory): should be a ``property`` of the
1617
``ComplianceCheck``:
@@ -56,7 +57,7 @@ warnings, the number of issues fixed by fixers (if applicable), links to report
5657
evidences generated (if applicable) and a link to the check runbook that
5758
contains remediation instructions (if applicable).
5859

59-
The following sections describe the notifiers supported by the compliance-tool.
60+
The following sections describe the notifiers supported by the framework.
6061

6162
File descriptor
6263
---------------
@@ -144,26 +145,26 @@ Channel ID ``11223344`` can be obtained quickly from the URL to a
144145
message of the target private channel. Of course, the Slack App needs
145146
to be part of the private channel.
146147

147-
GitHub Enterprise Issue
148-
-----------------------
148+
GitHub Issue
149+
------------
149150

150151
Depending on the configuration this notifier will create or update a GitHub
151152
issue per check or as a summary issue per accreditation. If an open issue
152153
already exists then the notification will be added to the existing issue as
153154
an issue comment otherwise a new issue will be created.
154155

155156
This notifier needs to know the credentials for interacting with the provided
156-
GitHub Enterprise repositories. Your credentials should, at a minimum, have
157+
GitHub repositories. Your credentials should, at a minimum, have
157158
``write`` access to all repositories specified for notifications to function
158-
correctly. Provide your GitHub Enterprise id and personal access token in your
159+
correctly. Provide your GitHub id and personal access token in your
159160
credentials file as shown below::
160161

161-
[github_enterprise]
162-
username=my-ghe-id
163-
token=my-ghe-personal-access-token
162+
[github]
163+
username=my-gh-id
164+
token=my-gh-personal-access-token
164165

165-
GHE Summary Issue by Accreditation
166-
**********************************
166+
GH Summary Issue by Accreditation
167+
*********************************
167168

168169
A configuration element for each accreditation is necessary to send summary
169170
issue notifications using this notifier. Summary notifications send all
@@ -172,8 +173,8 @@ configuration should consist of a list of repositories to send the notifications
172173
to, optionally a project and column to assign your notification to, along
173174
with a "summary_issue" sub-document dictionary that is used by the notifier to
174175
configure the summary issue. To specify a repository provide the GitHub
175-
Enterprise "owner" and "repository" in the form of ``owner/repository``.
176-
The "summary_issue" can be configured with the following fields:
176+
"owner" and "repository" in the form of ``owner/repository``. The "summary_issue"
177+
can be configured with the following fields:
177178

178179
- "title"
179180
- Required
@@ -206,11 +207,11 @@ The "summary_issue" can be configured with the following fields:
206207
upon creation
207208
- "assignees"
208209
- Optional
209-
- List of strings (GHE user IDs)
210+
- List of strings (GH user IDs)
210211
- Assigns the issue to the list of users
211212
- "rotation"
212213
- Optional
213-
- List of lists of strings (GHE user IDs)
214+
- List of lists of strings (GH user IDs)
214215
- The "frequency" is required when setting a rotation
215216
- When present with "frequency", overrides the "assignees" setting
216217
- Assigns the issue to the list of users based on the frequency and order
@@ -222,7 +223,7 @@ compliance checks::
222223

223224
{
224225
"notify": {
225-
"ghe_issues": {
226+
"gh_issues": {
226227
"accr1": {
227228
"repo": ["my-org/accr1-repo"],
228229
"project": {"Super cool project": "Triage"},
@@ -242,15 +243,15 @@ compliance checks::
242243
}
243244
}
244245

245-
GHE Issue Per Check
246-
*******************
246+
GH Issue Per Check
247+
******************
247248

248249
A configuration element for each accreditation is necessary to send
249250
notifications per check using this notifier. Each accreditation configuration
250251
should consist of a list of repositories to send the notifications to, a
251252
list of check execution statuses to send notifications for, and optionally a
252253
list of projects boards and project columns to add the notification issues to.
253-
To specify a repository provide the GitHub Enterprise "owner" and "repository"
254+
To specify a repository provide the GitHub "owner" and "repository"
254255
in the form of ``owner/repository``. Valid status values include "pass",
255256
"warn", "fail", and "error". If no status configuration is provided then the
256257
"fail" status is used as the default. Finally to specify project boards to
@@ -261,7 +262,7 @@ with the ``-C`` option when executing your compliance checks::
261262

262263
{
263264
"notify": {
264-
"ghe_issues": {
265+
"gh_issues": {
265266
"accr1": {
266267
"repo": ["my-org/accr1-repo"],
267268
"project": {"Super cool project": "Triage"},

doc-source/quick-start.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ You might want to push the evidences generated by ``--fetch`` into a
4848
remote git repository. For that, you can use ``--evidence`` and ``-C
4949
setup.json``. This ``setup.json`` contains a fake URL of the repo, you
5050
can edit it to match the URL you want. However, you have to provide
51-
GitHub Enterprise credentials. By default, you should use
51+
GitHub credentials. By default, you should use
5252
``~/.credentials`` (or use ``--creds-path`` to point somewhere else)::
5353

54-
[github_enterprise]
54+
[github]
5555
token=XXX
5656

5757
Once you have set it up, you can run the fetchers in ``no-push``

0 commit comments

Comments
 (0)