Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 9018ade

Browse files
[SDD] Supporting introspection in spk init --interactive command (#407)
Co-authored-by: Samiya Akhtar <[email protected]>
1 parent 698ef7b commit 9018ade

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Software Design Document
2+
3+
Reference: spk init interactive mode - supporting introspection configuration
4+
5+
<p>
6+
Authors:
7+
8+
- Samiya Akhtar, [email protected]
9+
- Andre Briggs, [email protected]
10+
- Dennis Seah, [email protected]
11+
</p>
12+
13+
---
14+
15+
| Revision | Date | Author | Remarks |
16+
| -------: | ------------ | ----------- | --------------------------------- |
17+
| 0.1 | Mar-16, 2020 | Dennis Seah | Initial Draft |
18+
| 0.2 | Mar-17, 2020 | Dennis Seah | Having key vault name as optional |
19+
20+
## 1. Overview
21+
22+
Our objective is to improve the usability of `spk init` command. We have already
23+
added very basic support for prompting organization name, project name and
24+
personal access token; and writing them into `spk` `config.yaml` file.
25+
26+
We hope to extend this effort to cover the basic setup for introspection
27+
configuration values. We shall prompt for the values and validate them
28+
accordingly.
29+
30+
Setting up introspection configuration values shall be optional. User can choose
31+
to skip it.
32+
33+
<p style="text-align:center">
34+
<img src="spkInitSupportIntrospection.png" width="600px">
35+
</p>
36+
37+
## 2. Out of Scope
38+
39+
This design shall only consider the case wher user already has Azure storage
40+
account and table setup. That's service principal's information and subscription
41+
identifier are not needed in this scenario.
42+
43+
## 3. Design Details
44+
45+
<p style="text-align:center">
46+
<img src="spkInitSupportIntrospection1.png" width="175px">
47+
</p>
48+
49+
User needs to provide these information
50+
51+
1. Storage Account Name
52+
- Lowercase letters and numbers are allowed;
53+
- 3 to 24 characters long
54+
1. Storage Table Name
55+
- Alphanumeric and start with an alphabet;
56+
- 3 to 63 characters long
57+
1. Key Vault Name (optional)
58+
- Alphanumerics and hyphens.
59+
- Start with letter. End with letter or digit. Can't contain consecutive
60+
hyphens.
61+
- 3 to 24 characters long
62+
1. Source Repo Access Token (Secret)
63+
- cannot be empty string
64+
1. Partition Table Name
65+
- cannot be empty string
66+
67+
Note:
68+
69+
> The command line tool will read these values from existing `spk` `config.yaml`
70+
> (if this file exists) and have the values in `config.yaml` as default value
71+
> for each prompt. E.g. you have `my-secret` as Storage Account Key, you will
72+
> have a prompt like this.
73+
74+
```
75+
? Enter Storage Account Key
76+
(my-secret)
77+
```
78+
79+
You can hit enter key to accept the default value or enter a new value.
80+
81+
Note:
82+
83+
> `spk` `config.yaml` shall not be created if any of the values are invalid.
84+
85+
## 4. Dependencies
86+
87+
None.
88+
89+
## 5. Risks & Mitigations
90+
91+
The content in `spk` `config.yaml` in the `<user-home>/.spk` folder shall be
92+
overwritten. User may lost important information.
93+
94+
## 6. Documentation
95+
96+
Documentation shall be in the `.md` file of the command.
97+
98+
\- end -
Loading
Loading

0 commit comments

Comments
 (0)