Skip to content

Conversation

@lotsofthoughts
Copy link
Contributor

Key Information:

We added $ruleset.getRulesetBypassList() as a method for pulling all bypass
actors for all rulesets. This is a requirement as we finish the complete
Ruleset, Rule, and Branch Protection/ Bypass framework.

We also added a bunch of 0.2.9 types:

  • GithubRuleset and associated interfaces

  • RulesetBypassActor for bypassActor interface

  • RulesetConditionRefName for rulesetConditions interface

  • Implemented customFields for report types from dynamic object for use in
    rules reporting in pass/fail report scenarios

  • Implemented custom exceptions for report types

  • Implemented dynamic repository + owner object for executeCode() in
    customFields by default

  • Implemented createReport function with hooks which are now dynamic
    functions executed at runtime in reportExecution

  • Implemented createReportEntry function accepting CustomWith* generic types
    for handling exceptions as part of the rules engine reporting feature.

  • Implemented report.addEntry and Reporting object using observer pattern to
    accept new entries and merge them into the JSON aggregation object.

    Example: custom fields

In the below example we use
exts.$reporting.createReportEntry<exts.Type.ReportEntryWithNone<ReportRecord>>

That is the reportEntry typeand its interface allows:

  • exts.Type.ReportEntryWithNone<ReportRecord>
  • exts.Type.ReportEntryWithErrors<ReportRecord>

This flexibility allows any developer to create custom fields and even custom
object types for the aggregate reporting capabilities:

  1. Custom Object Types i.e.- type ReportRecord = Record<string, unknown> for
    customFields automatically uses your type in the Report class.
  2. Use exts.$reporting.createReport to create a new report object for each
    test on each repository
  3. Use exts.$reporting.notifyTeamsHookto create teams notifications as a hook
  4. Use anyFunction as a hook in exts.$reporting.createReport
  5. Customize the report entry easily using a dynamic report:
// passing test dynamic-report:
import * as exts from 'jsr:@softdist/extensions@0.2.9'
const report = await exts.$reporting.createReport(
  [async (entry) => {
    await exts.$reporting.notifyTeamsHook(
      `Rule: ${entry.rule} | Repo: ${entry.repo} | Status: ${
        entry.success ? 'PASS' : 'FAIL'
      }`,
    )
  }],
  'report_aggregate.json',
)
type ReportRecord = Record<string, unknown>

await report.addEntry(
  'aggregate_report',
  exts.$reporting.createReportEntry<
    exts.Type.ReportEntryWithNone<ReportRecord>
  >({
    data: '',
    customFields: {
      notify: 'teams1'
    },
  }),
)

@lotsofthoughts lotsofthoughts self-assigned this Jun 24, 2025
@mckesson-lynsei
Copy link
Contributor

mckesson-lynsei commented Jun 30, 2025

v0.3.5 :shipit: 💯 👍🏻 Looks good to me captain

@lotsofthoughts lotsofthoughts merged commit d0355bd into main Jun 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants