Skip to content

Commit d0355bd

Browse files
feature/story_141: Report Hooks | Error Handlers | Aggregation (#2)
* Added Report Hooks | Error Handlers * Added Aggregation to reporting * Added 15 Policies for Github Rulesets and Branch Protections * Added permissions scans * Added regex for CODEOWNERS files
1 parent 238f6b7 commit d0355bd

29 files changed

+906
-187
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run Test Coverage
2+
permissions:
3+
contents: write
4+
on: [push, pull_request]
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Deno
11+
uses: denoland/setup-deno@v2
12+
with:
13+
deno-version: v2.x
14+
15+
- name: Install npm Dependencies
16+
run: deno install
17+
- name: Unit and Integration Tests Job
18+
env:
19+
PROD_TOKEN: ${{ secrets.PROD_TOKEN }}
20+
PROD_REPO: ${{ secrets.PROD_REPO }}
21+
PROD_OWNER: 'pkgdist'
22+
TEAMS_WEB_HOOK: ${{ env.TEAMS_WEB_HOOK }}
23+
run: |
24+
deno test --allow-env --allow-read --allow-write --allow-net --allow-sys --allow-run --coverage=coverage --trace-leaks
25+
- name: Generate coverage report
26+
env:
27+
PROD_TOKEN: ${{ secrets.PROD_TOKEN }}
28+
PROD_REPO: ${{ secrets.PROD_REPO }}
29+
PROD_OWNER: 'pkgdist'
30+
TEAMS_WEB_HOOK: ${{ env.TEAMS_WEB_HOOK }}
31+
run: |
32+
deno coverage coverage --lcov > coverage.lcov
33+
deno coverage coverage --html report
34+
echo "HTML coverage in ./report/index.html"
35+
36+
- name: Upload coverage HTML
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: html-coverage
40+
path: coverage/html/index.html

.semver.build.tag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.5+38821
1+
0.3.0+41161

.semver.commit.tag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Last Commit: commit 637fe303c8f42fcab74a7dde6cce311881bf3325
1+
Last Commit: commit 28c1bb07d3d3950a3bc609c6406ca58f193e7d76
22
Author: Lyns <lotsofthoughts@lynsei.com>
3-
Date: Mon Jun 23 12:37:10 2025 -0400
3+
Date: Fri Jun 27 15:42:52 2025 -0400

.semver.version.tag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.7
1+
0.3.1

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ install: ## Install all required SAST tools, hooks, and repository tags, multi-c
8484
make setup-brew
8585
make install-tools
8686
make tag
87+
make test
8788
make check
8889
make bump-build
8990
make set-version
@@ -139,14 +140,14 @@ bump-build: ## Bump the build version to a random build number
139140
build-release: ## Run release build
140141
./scripts/build_release.sh
141142

142-
ci-bump: ## Build number (bump) releases: Full CI Add-Commit-Tag-Push Process i.e.- '$make ci-bump int="109" msg="feature/story_109: Msg"'
143+
ci-bump: ## Bump the build bump and commit-tag-push i.e.- '$make ci-bump int="109" msg="feature/story_109: Msg"'
143144
./scripts/ci_bump.sh $(int) "$(msg)"
144145

145-
ci-patch: ## Patch releases: Full CI Add-Commit-Tag-Push Process
146+
ci-patch: ## Patch releases bump and commit-tag-push
146147
./scripts/ci_patch.sh $(int) "$(msg)"
147148

148-
ci-minor: ## Minor releases: Full CI Process Add-Commit-Tag-Push Process
149+
ci-minor: ## Minor releases bump and commit-tag-push
149150
./scripts/ci_minor.sh $(int) "$(msg)"
150151

151-
ci-major: ## Major releases: Full CI Process Add-Commit-Tag-Push Process
152+
ci-major: ## Major releases bump and commit-tag-push
152153
./scripts/ci_minor.sh $(int) "$(msg)"

README.md

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,36 @@ for information on the latest release.
2222
>
2323
> This @softdist/extensions module is generic and opensource
2424
25-
This is a library for reporting and scoring tools. These tools can be used for
26-
virtually any purpose as a standard reporting & notifications library. The
27-
project goal is to provide a variety of reporting options which can be extended
28-
easily for scoring, notifications, or to generate complex reports based on the
29-
inspection of Github Scopes, Azure Scopes, and other objects.
25+
This is a general library for comparison, github scopes, and reporting. These
26+
tools can be used for virtually any purpose as a standard reporting &
27+
notifications library. The project goal is to provide a variety of reporting
28+
options which can be extended easily for scoring, notifications, or to generate
29+
complex reports based on the inspection of Github Scopes, Azure Scopes, and
30+
other objects.
3031

3132
## Exported Modules
3233

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-
| `$reporting` | v2 of the report functionality implements a Reporting object and the concept of hooks |
42-
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
43-
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
44-
| `$webhook` | Webhook secret acquisition IFFE functions |
34+
| Feature Name | Purpose |
35+
| :----------- | :------------------------------------------------------------------------------------- |
36+
| `$colors` | Automatic error logging and warn/notice stream logging with colors |
37+
| `$const` | Declared generic constants for local system paths and GITHUB API |
38+
| `$compare` | Comparison functions for deep YML objects. |
39+
| `$error` | Generic error functions for including messages with specific colors |
40+
| `$file` | File regex and comparison functions. |
41+
| `$perms` | Permissions scanning functions |
42+
| `$ruleset` | Github Rulesets and Rule scopes for detecting branch protections |
43+
| `$report` | Async reporting stream for tabulation of callback data into a simplified report stream |
44+
| `$reporting` | Reporting object and the concept of hooks and custom entry types/ exceptions. |
45+
| `$streams` | Optic FileStream object for logging colored error messages to evaluated streams |
46+
| `$token` | Token acquisition for GitHub CLI default, or .envcrypt files, or environment vars |
47+
| `$webhook` | Webhook secret acquisition IFFE functions |
4548

4649
## Exported Variables
4750

48-
| Variable | Description |
49-
| :----------------- | :---------------------------------- |
50-
| `generatedVersion` | Software Version Information |
51-
| `Type` | Types used throughout this software |
51+
| Variable | Description |
52+
| :----------------- | :------------------------------------------------- |
53+
| `generatedVersion` | Software Version Information |
54+
| `Type` | Types and Interfaces used throughout this software |
5255

5356
## Github Scopes
5457

@@ -90,7 +93,7 @@ The purpose is to abstract the reporting methods into a JSR package which can be
9093
called using `deno run` by passing the `--import-map` flag and referencing a
9194
JSON import map file containing this package.
9295

93-
### Reporting Custom Objects in 0.2.6
96+
### Reporting Custom Objects in 0.2.6+
9497

9598
Passing custom objects to the `createReport` function is now trivial.
9699

@@ -149,7 +152,7 @@ Here is an example import map for testing
149152
"@onjara/optic": "jsr:@onjara/optic@^2.0.3",
150153
"@alikia/random-key": "jsr:@alikia/random-key@^1.0.1",
151154
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
152-
"@softdist/extensions": "jsr:@softdist/extensions@0.2.4",
155+
"@softdist/extensions": "jsr:@softdist/extensions@0.3.0",
153156
"@std/assert": "jsr:@std/assert@1.0.13",
154157
"@std/fmt": "jsr:@std/fmt@^1.0.7",
155158
"@std/fs": "jsr:@std/fs@^1.0.17",
@@ -169,15 +172,21 @@ Here is an example import map for testing
169172
The following diagram explains the current logical flow of how to call and
170173
utilize this package.
171174

175+
## Logical Diagram
176+
177+
The following logical diagram is written in Mermaid and does not display on
178+
jsr.io.
179+
[View Diagram on Github](https://github.com/pkgdist/extensions?tab=readme-ov-file#logical-diagram).
180+
172181
```mermaid
173182
---
174-
title: Rule Engine Binary
183+
title: Extensions
175184
---
176185
graph TD;
177-
external_program-->dynamic_code_execution-->import_statement-->softdist_extensions
178-
softdist_extensions-->reporting-->scopes-->github
179-
scopes-->azure
180-
softdist_extensions-->notifications-->webhooks
186+
external_program-->dynamic_code_execution-->import_statement-->extensions
187+
extensions-->reporting-->scopes-->github
188+
extensions-->notifications-->webhooks
189+
extensions-->aggregate-->custom_types-->custom_entries-->custom_exceptions
181190
```
182191

183192
## About FileStream

deno.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softdist/extensions",
3-
"version": "0.2.7",
3+
"version": "0.3.1",
44
"license": "MIT",
55
"exports": "./src/mod.ts",
66
"test": {
@@ -58,11 +58,12 @@
5858
"@octokit/core": "npm:@octokit/core@^7.0.2",
5959
"@onjara/optic": "jsr:@onjara/optic@^2.0.3",
6060
"@alikia/random-key": "jsr:@alikia/random-key@^1.0.1",
61-
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
61+
"@deno/dnt": "jsr:@deno/dnt@^0.42.1",
6262
"@std/assert": "jsr:@std/assert@1.0.13",
6363
"@std/fmt": "jsr:@std/fmt@^1.0.7",
64-
"@std/fs": "jsr:@std/fs@^1.0.17",
64+
"@std/fs": "jsr:@std/fs@^1.0.18",
6565
"@cliffy/command": "jsr:@cliffy/command@^1.0.0-rc.7",
66-
"lefthook": "npm:lefthook@^1.11.12"
66+
"@std/path": "jsr:@std/path@^1.1.0",
67+
"lefthook": "npm:lefthook@^1.11.14"
6768
}
6869
}

0 commit comments

Comments
 (0)