Skip to content

Commit 3cbda1a

Browse files
feature/story_116
Signed-off-by: Lyns <lotsofthoughts@lynsei.com>
1 parent 0f4839a commit 3cbda1a

File tree

3 files changed

+82
-74
lines changed

3 files changed

+82
-74
lines changed

README.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@ inspection of Github Scopes, Azure Scopes, and other objects.
3030

3131
## Exported Modules
3232

33-
| Feature Name | Purpose |
34-
| :----------------- | :---------------------------------------------------------------------------------------- |
35-
| `$colors` | Automatic error logging and warn/notice stream logging with colors |
36-
| `$const` | Declared generic constants for local system paths and GITHUB API |
37-
| `$compare` | Comparison functions for deep YML objects. |
38-
| `$error` | Generic error functions for including messages with specific colors |
39-
| `$ruleset` | Github Rulesets and Rule scopes for detecting branch protections |
40-
| `$report` | Reporting function for scoring tabulation in streams, and notification functions in teams |
41-
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
42-
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
43-
| `$webhook` | Webhook secret acquisition IFFE functions |
33+
| Feature Name | Purpose |
34+
| :----------- | :---------------------------------------------------------------------------------------- |
35+
| `$colors` | Automatic error logging and warn/notice stream logging with colors |
36+
| `$const` | Declared generic constants for local system paths and GITHUB API |
37+
| `$compare` | Comparison functions for deep YML objects. |
38+
| `$error` | Generic error functions for including messages with specific colors |
39+
| `$ruleset` | Github Rulesets and Rule scopes for detecting branch protections |
40+
| `$report` | Reporting function for scoring tabulation in streams, and notification functions in teams |
41+
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
42+
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
43+
| `$webhook` | Webhook secret acquisition IFFE functions |
4444

4545
## Exported Variables
4646

47-
| Variable | Description |
48-
| :----------------- | :---------------------------------------------------------------------------------------- |
49-
| `generatedVersion` | Software Version Information |
50-
| `Type` | Types used throughout this software |
47+
| Variable | Description |
48+
| :----------------- | :---------------------------------- |
49+
| `generatedVersion` | Software Version Information |
50+
| `Type` | Types used throughout this software |
5151

5252
## Github Scopes
5353

5454
We refer to Github Scopes frequently, and by scopes we mean the resources that
55-
RBAC permissions apply to on Github.
55+
RBAC permissions apply to on Github.
5656

5757
#### Examples of Github Scopes
5858

@@ -64,20 +64,21 @@ RBAC permissions apply to on Github.
6464
- Organizations
6565
- Gists
6666

67-
There are many more examples, but you get the idea. Scopes are basically any
68-
major section of the Github API.
67+
There are many more examples, but you get the idea. Scopes are basically any
68+
major section of the Github API.
6969

7070
## Other Scopes
7171

72-
Currently this software only incorporates Github scopes, however in the future we will be adding
73-
additional scopes such as:
72+
Currently this software only incorporates Github scopes, however in the future
73+
we will be adding additional scopes such as:
7474

7575
1. Azure
7676
2. AWS
7777
3. JFrog
7878
4. Terraform IAC
7979

80-
One option here is that we will likely be adding a connector for popular configuration management software such as Ansible in future versions.
80+
One option here is that we will likely be adding a connector for popular
81+
configuration management software such as Ansible in future versions.
8182

8283
## Reporting Features
8384

@@ -88,32 +89,32 @@ The purpose is to abstract the reporting methods into a JSR package which can be
8889
called using `deno run` by passing the `--import-map` flag and referencing a
8990
JSON import map file containing this package.
9091

91-
9292
### Notifications
9393

94-
Currently the only notification feature is `webhook` fire. This is used primarily for `MS Teams` integrations.
95-
You can use it by setting `TEAMS_WEB_HOOK` as an environment variable.
96-
94+
Currently the only notification feature is `webhook` fire. This is used
95+
primarily for `MS Teams` integrations. You can use it by setting
96+
`TEAMS_WEB_HOOK` as an environment variable.
9797

9898
### Import Map
9999

100-
Here is an example import map for testing `deno run --import-map ./deps.json ./src/check_ruleset.ts`:
100+
Here is an example import map for testing
101+
`deno run --import-map ./deps.json ./src/check_ruleset.ts`:
101102

102103
```json
103-
{
104-
"imports": {
105-
"@octokit/core": "npm:@octokit/core@^7.0.2",
106-
"@onjara/optic": "jsr:@onjara/optic@^2.0.3",
107-
"@alikia/random-key": "jsr:@alikia/random-key@^1.0.1",
108-
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
109-
"@softdist/extensions": "jsr:@softdist/extensions@0.2.1",
110-
"@std/assert": "jsr:@std/assert@1.0.13",
111-
"@std/fmt": "jsr:@std/fmt@^1.0.7",
112-
"@std/fs": "jsr:@std/fs@^1.0.17",
113-
"@cliffy/command": "jsr:@cliffy/command@^1.0.0-rc.7",
114-
"lefthook": "npm:lefthook@^1.11.12"
115-
}
104+
{
105+
"imports": {
106+
"@octokit/core": "npm:@octokit/core@^7.0.2",
107+
"@onjara/optic": "jsr:@onjara/optic@^2.0.3",
108+
"@alikia/random-key": "jsr:@alikia/random-key@^1.0.1",
109+
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
110+
"@softdist/extensions": "jsr:@softdist/extensions@0.2.1",
111+
"@std/assert": "jsr:@std/assert@1.0.13",
112+
"@std/fmt": "jsr:@std/fmt@^1.0.7",
113+
"@std/fs": "jsr:@std/fs@^1.0.17",
114+
"@cliffy/command": "jsr:@cliffy/command@^1.0.0-rc.7",
115+
"lefthook": "npm:lefthook@^1.11.12"
116116
}
117+
}
117118
```
118119

119120
> [!TIP]

release-notes.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Extensions
22

3-
Release notes for the `@softdist/extension` system: An abstract extension system for inspection of Github scopes.
3+
Release notes for the `@softdist/extension` system: An abstract extension system
4+
for inspection of Github scopes.
45

5-
* Package: [@softdist/extensions](https://jsr.io/@softdist/extensions)
6-
* Repository: [@pkgdist/extensions](https://github.com/pkgdist/extensions)
6+
- Package: [@softdist/extensions](https://jsr.io/@softdist/extensions)
7+
- Repository: [@pkgdist/extensions](https://github.com/pkgdist/extensions)
78

89
## Version 0.2.2
910

@@ -14,12 +15,12 @@ Release notes for the `@softdist/extension` system: An abstract extension syste
1415
>
1516
> PATCH UPDATE
1617
17-
Github Scopes Update.
18+
Github Scopes Update.
1819

19-
> Expect a lot more of these types of features for detecting
20-
Github settings.
20+
> Expect a lot more of these types of features for detecting Github settings.
2121
22-
This is the first in the group, and it deals with Github Repository Rulesets, Rules, and their parameters.
22+
This is the first in the group, and it deals with Github Repository Rulesets,
23+
Rules, and their parameters.
2324

2425
- **Ruleset checks**
2526
- Tests for Rulesets
@@ -64,24 +65,24 @@ multi-purpose.
6465
6566
## Exported Modules
6667

67-
| Feature Name | Purpose |
68-
| :----------------- | :---------------------------------------------------------------------------------------- |
69-
| `$colors` | Automatic error logging and warn/notice stream logging with colors |
70-
| `$const` | Declared generic constants for local system paths and GITHUB API |
71-
| `$compare` | Comparison functions for deep YML objects. |
72-
| `$error` | Generic error functions for including messages with specific colors |
73-
| `$ruleset` | Github Rulesets and Rule scopes for detecting branch protections |
74-
| `$report` | Reporting function for scoring tabulation in streams, and notification functions in teams |
75-
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
76-
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
77-
| `$webhook` | Webhook secret acquisition IFFE functions |
68+
| Feature Name | Purpose |
69+
| :----------- | :---------------------------------------------------------------------------------------- |
70+
| `$colors` | Automatic error logging and warn/notice stream logging with colors |
71+
| `$const` | Declared generic constants for local system paths and GITHUB API |
72+
| `$compare` | Comparison functions for deep YML objects. |
73+
| `$error` | Generic error functions for including messages with specific colors |
74+
| `$ruleset` | Github Rulesets and Rule scopes for detecting branch protections |
75+
| `$report` | Reporting function for scoring tabulation in streams, and notification functions in teams |
76+
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
77+
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
78+
| `$webhook` | Webhook secret acquisition IFFE functions |
7879

7980
## Exported Variables
8081

81-
| Variable | Description |
82-
| :----------------- | :---------------------------------------------------------------------------------------- |
83-
| `generatedVersion` | Software Version Information |
84-
| `Type` | Types used throughout this software |
82+
| Variable | Description |
83+
| :----------------- | :---------------------------------- |
84+
| `generatedVersion` | Software Version Information |
85+
| `Type` | Types used throughout this software |
8586

8687
Each registry of rules will be published in the engine itself, not this module.\
8788
The purpose of this module is to abstract any reporting or evaluation features

src/tests/tests.func_ruleset.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import * as $ruleset from '../func_rules.ts'
22
import * as $token from '../func_token.ts'
3-
import { assertEquals } from "jsr:@std/assert@^0.224.0/assert-equals"
3+
import { assertEquals } from 'jsr:@std/assert@^0.224.0/assert-equals'
44

55
Deno.test({
6-
name: "assertRulesetByIndexParameter - copilotCodeReviewEnabled is true",
6+
name: 'assertRulesetByIndexParameter - copilotCodeReviewEnabled is true',
77
sanitizeResources: false,
88
sanitizeOps: false,
99
async fn() {
1010
const token = await $token.getToken()
1111
if (!token) {
12-
throw new Error('No GitHub token found. Please set the GITHUB_TOKEN environment variable.')
12+
throw new Error(
13+
'No GitHub token found. Please set the GITHUB_TOKEN environment variable.',
14+
)
1315
}
1416
const repoData = {
1517
token,
@@ -27,18 +29,20 @@ Deno.test({
2729
value,
2830
repoData,
2931
)
30-
assertEquals(result, "true")
31-
}
32+
assertEquals(result, 'true')
33+
},
3234
})
3335

3436
Deno.test({
35-
name: "assertRulesetByIndexParameter - requireStatusChecksToPass is true",
37+
name: 'assertRulesetByIndexParameter - requireStatusChecksToPass is true',
3638
sanitizeResources: false,
3739
sanitizeOps: false,
3840
async fn() {
3941
const token = await $token.getToken()
4042
if (!token) {
41-
throw new Error('No GitHub token found. Please set the GITHUB_TOKEN environment variable.')
43+
throw new Error(
44+
'No GitHub token found. Please set the GITHUB_TOKEN environment variable.',
45+
)
4246
}
4347
const repoData = {
4448
token,
@@ -56,18 +60,20 @@ Deno.test({
5660
value,
5761
repoData,
5862
)
59-
assertEquals(result, "true")
60-
}
63+
assertEquals(result, 'true')
64+
},
6165
})
6266

6367
Deno.test({
64-
name: "assertRulesetByIndexParameter - requireBranchesUpToDate is true",
68+
name: 'assertRulesetByIndexParameter - requireBranchesUpToDate is true',
6569
sanitizeResources: false,
6670
sanitizeOps: false,
6771
async fn() {
6872
const token = await $token.getToken()
6973
if (!token) {
70-
throw new Error('No GitHub token found. Please set the GITHUB_TOKEN environment variable.')
74+
throw new Error(
75+
'No GitHub token found. Please set the GITHUB_TOKEN environment variable.',
76+
)
7177
}
7278
const repoData = {
7379
token,
@@ -85,6 +91,6 @@ Deno.test({
8591
value,
8692
repoData,
8793
)
88-
assertEquals(result, "true")
89-
}
94+
assertEquals(result, 'true')
95+
},
9096
})

0 commit comments

Comments
 (0)