Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 296dc59

Browse files
authored
docs: tutorials: rolling alice: coach alice: our open source guide: Explain how to have Alice please contribute more recommended community standards
1 parent af4306a commit 296dc59

File tree

1 file changed

+99
-15
lines changed

1 file changed

+99
-15
lines changed

docs/tutorials/rolling_alice/0001_coach_alice/0002_our_open_source_guide.md

Lines changed: 99 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,108 @@ Install Alice https://github.com/intel/dffml/tree/alice/entities/alice
1818

1919
We want to be able to ask Alice to contribute [recommended community standards](https://opensource.guide/) to our projects.
2020

21+
## Setup
22+
23+
First let's create a repo to work with
24+
25+
```console
26+
$ gh repo create -y --private https://github.com/$USER/my-new-python-project
27+
$ git clone https://github.com/$USER/my-new-python-project
28+
$ cd my-new-python-project
29+
$ echo 'print("Hello World")' > test.py
30+
$ git add test.py
31+
$ git commit -sam 'Initial Commit'
32+
$ git push --set-upstream origin main
33+
```
34+
35+
## How to help Alice contribute more files
36+
37+
38+
This tutorial will help you create a new Open Architecture / Alice
39+
overlay which runs when another flow runs. The upstream flow
40+
in this case is the `AlicePleaseContributeRecommendedCommunityStandards`
41+
base flow.
42+
43+
Copy readme overlay to new file
44+
45+
```console
46+
$ cp alice/please/contribute/recommended_community_standards/readme.py alice/please/contribute/recommended_community_standards/contribute.py
47+
```
48+
49+
Rename types, classes, variables, etc.
50+
51+
```console
52+
$ sed -e 's/Readme/Contributing/g' -e 's/README/CONTRIBUTING/g' -e 's/readme/contributing/g' -i alice/please/contribute/recommended_community_standards/contribute.py
53+
```
54+
55+
Add `OverlayCONTRIBUTING` to the list of overlays to be applied to the
56+
`dffml.overlays.alice.please.contribute.recommended_community_standard`
57+
base flow.
58+
59+
**dffml.git/entites/alice/entry_points.txt**
60+
61+
```diff
62+
diff --git a/entities/alice/entry_points.txt b/entities/alice/entry_points.txt
63+
index 129b2866a1..9e130cb3b2 100644
64+
--- a/entities/alice/entry_points.txt
65+
+++ b/entities/alice/entry_points.txt
66+
@@ -9,6 +9,7 @@ CLI = alice.please.contribute.recomme
67+
OverlayGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGit
68+
OverlayGitHub = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGitHub
69+
OverlayREADME = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayREADME
70+
+OverlayCONTRIBUTING = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayCONTRIBUTING
71+
# OverlayMetaIssue = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayMetaIssue
72+
73+
[dffml.overlays.alice.please.contribute.recommended_community_standards.overlay.readme]
74+
```
75+
76+
Add the `OverlayGit` and `OverlayGitHub` overlays to the new overlay as well.
77+
78+
**dffml.git/entites/alice/entry_points.txt**
79+
80+
```ini
81+
[dffml.overlays.alice.please.contribute.recommended_community_standards.overlay.contributing]
82+
OverlayGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGit
83+
OverlayGitHub = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGitHu
84+
```
85+
86+
Reinstall for new entrypoints to take effect
87+
88+
```console
89+
$ python -m pip install -e .
90+
```
91+
92+
- Re-run the command and observe results
93+
94+
```console
95+
$ alice please contribute -log debug -repos https://github.com/$USER/my-new-python-project -- recommended community standards
96+
```
97+
2198
```console
22-
$ alice please contribute -repos https://github.com/intel/dffml -- recommended community standards
99+
$ gh -R https://github.com/$USER/my-new-python-project pr list
100+
297 Recommended Community Standard: README alice-contribute-recommended-community-standards-readme OPEN
101+
295 Recommended Community Standard: CONTRIBUTING alice-contribute-recommended-community-standards-contributing OPEN
23102
```
24103

104+
![Screenshot showing pull request for adding README.md and CONTRIBUTING.md files](https://user-images.githubusercontent.com/5950433/181796646-0b49335c-7739-4dff-bce4-bab98a8fc560.png)
105+
106+
## Debugging
107+
108+
```console
109+
for pr in $(gh -R https://github.com/$USER/ pr list --json number --jq '.[].number'); do gh -R https://github.com/pdxjohnny/testaaaa pr close "${pr}"; done;
110+
```
111+
112+
## Future Work
113+
114+
This section is TODO but long term probably
115+
116+
- Future work
117+
- `-repos https://github.com/intel/dffml`
118+
- Infer from context (cwd)
119+
120+
### Meta Issue
121+
122+
Disabled for now
25123

26124
What the body of the issue should be
27125

@@ -45,17 +143,3 @@ We will omit for now
45143
- [] Pull request template
46144
- [] Repository admins accept content reports
47145
```
48-
49-
```console
50-
$ alice please contribute recommended community standards
51-
```
52-
53-
Show it working with gh pr list
54-
55-
Then show how to install an overlay which populates from `source.records()` from a source instantiated via an overlay operation triggered via autostart from looking at cli cmd when associated CLI overlay is installed (read from yml files from innersource example in main).
56-
57-
Finally show how we update into another source by installing another overlay which just defines what inputs it wants and then has an autostart for a source instantiation, then inserts the data from the output operations defined within the system context class of this overlay to show insert into "metrics" collection of mongodb.
58-
59-
- Future work
60-
- `-repos https://github.com/intel/dffml`
61-
- Infer from context (cwd)

0 commit comments

Comments
 (0)