Skip to content

RC #224#225

Merged
rmenner merged 6 commits into
mainfrom
rc/224
Nov 7, 2025
Merged

RC #224#225
rmenner merged 6 commits into
mainfrom
rc/224

Conversation

@rmenner

@rmenner rmenner commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator

Alaska Airlines Pull Request

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Extend documentation tooling, CLI commands, and CI migration support by enhancing the docs generator, enriching commit analysis with release notes, adding ADO integration for issue tracking, implementing a syncable .github template directory, and providing migration scripts for OIDC configuration.

New Features:

  • Include a modifiers column and alphabetical sorting in the API docs generator
  • Add release notes generation to the commit analyzer with a new CLI flag
  • Introduce an ado command to create and link Azure DevOps work items from GitHub issues
  • Implement a sync command option to pull and populate a template .github directory from a remote repo
  • Provide migration scripts and configuration for enabling Trusted Publishing (OIDC) in CI across multiple repos

Enhancements:

  • Refactor docs generator static methods to use destructured imports and centralize state on the Docs class
  • Restructure commit-analyzer to support conditional release note formatting and improved issue reference spacing
  • Clean up various utility modules by exposing new path utilities and updating logger typings

Build:

  • Add repository metadata and provenance flag to package.json publishConfig
  • Update dependencies to include Octokit, Azure DevOps API client, and npmcli package-json

Chores:

  • Bump @aurodesignsystem/auro-config dev dependency version
  • Remove legacy syncDotGithubDir.js in favor of a TypeScript implementation

@rmenner
rmenner requested a review from a team as a code owner November 7, 2025 22:24
@sourcery-ai

sourcery-ai Bot commented Nov 7, 2025

Copy link
Copy Markdown

Reviewer's Guide

This PR implements a series of feature expansions and refactors across documentation generation, commit analysis, CLI commands, CI/CIX migrations, and adds Azure DevOps integration by reorganizing static methods, adding new flags, and introducing new scripts for syncing and migrating configurations.

Sequence diagram for new ADO item creation from GitHub issue

sequenceDiagram
  actor User
  participant CLI
  participant "ADOIntegration (createADOItem)"
  participant "GitHub API"
  participant "Azure DevOps API"

  User->>CLI: Run `auro ado --gh-issue <issue>`
  CLI->>ADOIntegration: createADOItem(ghIssue)
  ADOIntegration->>GitHub API: fetchGitHubIssue(ghIssue)
  GitHub API-->>ADOIntegration: GitHubIssue
  ADOIntegration->>GitHub API: getExistingADOLink(GitHubIssue)
  GitHub API-->>ADOIntegration: ADO link or null
  alt ADO link exists
    ADOIntegration->>CLI: Output ADO link
  else No ADO link
    ADOIntegration->>Azure DevOps API: createADOWorkItem(GitHubIssue)
    Azure DevOps API-->>ADOIntegration: WorkItem
    ADOIntegration->>GitHub API: updateGitHubProject(GitHubIssue, WorkItem link)
    GitHub API-->>ADOIntegration: Success
    ADOIntegration->>CLI: Output WorkItem link
  end
Loading

Sequence diagram for new sync command with ref option

sequenceDiagram
  actor User
  participant CLI
  participant "SyncDotGithubDir"
  participant "GitHub API"

  User->>CLI: Run `auro sync --ref <branch/tag/commit>`
  CLI->>SyncDotGithubDir: syncDotGithubDir(cwd, ref)
  SyncDotGithubDir->>GitHub API: getFolderItemsFromRelativeRepoPath(path, ref)
  GitHub API-->>SyncDotGithubDir: Folder items
  SyncDotGithubDir->>SyncDotGithubDir: processFolderItemsIntoFileConfigs(...)
  SyncDotGithubDir->>SyncDotGithubDir: removeDirectory(.github)
  SyncDotGithubDir->>SyncDotGithubDir: processContentForFile(config)
  SyncDotGithubDir->>SyncDotGithubDir: generateDirectoryTree(.github)
  SyncDotGithubDir->>CLI: Output tree structure
Loading

Sequence diagram for commit analyzer release notes generation

sequenceDiagram
  actor User
  participant CLI
  participant "CommitAnalyzer"
  participant "Git API"

  User->>CLI: Run `auro check-commits --release-notes`
  CLI->>CommitAnalyzer: analyzeCommits(debug, setLabel, releaseNotes=true)
  CommitAnalyzer->>Git API: getCommitMessages()
  Git API-->>CommitAnalyzer: commitList
  CommitAnalyzer->>CommitAnalyzer: generateReleaseNotes(commitList)
  CommitAnalyzer->>CLI: Output release notes
Loading

Class diagram for Docs refactor in docs-generator.ts

classDiagram
  class Docs {
    +manifest: Package
    +constructor(options)
    +static getElements(): CustomElementDeclaration[]
    +static isWcaModule(module: Module): boolean
    +static renderAllElements(elements: CustomElementDeclaration[]): string
    +static renderElement(element: CustomElementDeclaration, includeTitle = true): string
    +static renderPropertiesAttributesTable(element: CustomElementDeclaration): string
    +static renderParameters(parameters?: Parameter[]): string
    +static renderTable(title, properties, data?): string
    +static getType(obj): string
    +static escapeMarkdown(str): string
    +static get(obj, path): any
    +static capitalize(str): string
  }
  Docs : manifest
  Docs : getElements()
  Docs : isWcaModule(module)
  Docs : renderAllElements(elements)
  Docs : renderElement(element, includeTitle)
  Docs : renderPropertiesAttributesTable(element)
  Docs : renderParameters(parameters)
  Docs : renderTable(title, properties, data)
  Docs : getType(obj)
  Docs : escapeMarkdown(str)
  Docs : get(obj, path)
  Docs : capitalize(str)

  class MergedTableData {
    +name: string
    +properties: string
    +attributes: string
    +modifiers: string
    +type: string
    +default: string
    +description: string
  }
  Docs --> MergedTableData
Loading

Class diagram for Azure DevOps integration (ado/index.ts)

classDiagram
  class GitHubIssue {
    +title: string
    +body: string | null
    +html_url: string
    +number: number
    +repository_owner_login: string
    +repository_name: string
  }
  class WorkItem {
    <<interface>>
    +id: number
    +_links_html_href: string
    ...
  }
  class AzureDevOps {
    +createADOWorkItem(issue: GitHubIssue): WorkItem
  }
  class GitHub {
    +fetchGitHubIssue(issueUrl: string): GitHubIssue
    +getExistingADOLink(issue: GitHubIssue): string | null
    +updateGitHubProject(issue: GitHubIssue, adoWorkItemUrl: string): void
  }
  class ADOIntegration {
    +createADOItem(ghIssue: string): void
  }
  ADOIntegration --> GitHub
  ADOIntegration --> AzureDevOps
  AzureDevOps --> WorkItem
  GitHub --> GitHubIssue
Loading

Class diagram for migration script (package-json-update-oidc/migration.js)

classDiagram
  class Migration {
    +updatePackageJson()
    +createNvmrcFile()
    +run()
  }
  Migration --> Logger
  Migration --> PackageJson
Loading

Class diagram for commit analyzer refactor (check-commits/commit-analyzer.ts)

classDiagram
  class CommitInfo {
    +type: string
    +hash: string
    +subject: string
    +body: string
  }
  class CommitAnalyzer {
    +generateReleaseNotes(commitList: CommitInfo[]): void
    +analyzeCommits(debug: boolean, setLabel: boolean, releaseNotes: boolean): Promise<void>
  }
  CommitAnalyzer --> CommitInfo
Loading

File-Level Changes

Change Details Files
Refactor and extend docs-generator implementation
  • Added modifiers column to properties table and merged type logic
  • Replaced instance references with static method destructuring and explicit Docs calls
  • Sorted elements by tagName and simplified join separators
src/scripts/docs/docs-generator.ts
Extend commit analyzer with release-notes support
  • Implemented generateReleaseNotes to filter and format feat/fix/breaking commits
  • Added --release-notes flag to analyzeCommits and commands interface
  • Injected detailed body parsing and issue-reference spacing logic
src/scripts/check-commits/commit-analyzer.ts
src/commands/check-commits.ts
Enhance CLI commands with new options
  • Added --ref option to sync command and passed ref to syncDotGithubDir
  • Extended check-commits to accept release-notes option
src/commands/sync.js
src/commands/check-commits.ts
Introduce Azure DevOps integration command
  • Created ADO script to fetch GitHub issues, map to work items, and update GitHub project
  • Exposed new ado command with --gh-issue option
src/scripts/ado/index.ts
src/commands/ado.ts
Add .github directory sync utility
  • Implemented syncDotGithubDir.ts to fetch templates via Octokit, remove and rebuild .github folder
  • Recursively process folder contents into FileProcessorConfig and render directory tree
src/scripts/syncDotGithubDir.ts
Update package.json metadata and dependencies
  • Added repository field, publishConfig provenance flag, engines upgrade
  • Bumped devDependencies, added new runtime deps (@npmcli/package-json, azure-devops-node-api)
package.json
Add OIDC migration scripts and .nvmrc
  • Included multi-gitter.yml workflow for OIDC support across multiple repos
  • Added migration script to update package.json and generate .nvmrc
  • Provided shell script wrapper for migration execution
src/migrations/package-json-update-oidc/multi-gitter.yml
src/migrations/package-json-update-oidc/migration.js
.nvmrc
src/migrations/package-json-update-oidc/script.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@rmenner rmenner linked an issue Nov 7, 2025 that may be closed by this pull request

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • In renderAllElements you replaced the --- separators with just blank lines—please confirm this still renders clear section breaks or reintroduce a visible delimiter if needed.
  • The new syncDotGithubDir script is very large and handles fetching templates, file processing, and directory tree generation—consider breaking it into smaller modules or helper utilities to improve readability and testability.
  • The ADO integration code uses hard-coded project number (19) and org details—consider making these values configurable via env vars or CLI options to avoid inflexible deployments.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In renderAllElements you replaced the `---` separators with just blank lines—please confirm this still renders clear section breaks or reintroduce a visible delimiter if needed.
- The new syncDotGithubDir script is very large and handles fetching templates, file processing, and directory tree generation—consider breaking it into smaller modules or helper utilities to improve readability and testability.
- The ADO integration code uses hard-coded project number (19) and org details—consider making these values configurable via env vars or CLI options to avoid inflexible deployments.

## Individual Comments

### Comment 1
<location> `src/scripts/docs/docs-generator.ts:225` </location>
<code_context>
           properties: prop.name,
           attributes: ('attribute' in prop ? prop.attribute as string : '') || "",
-          type: this.getType(prop) || "",
+          modifiers: ('readonly' in prop && prop.readonly ? 'readonly' : ''),
+          type: displayType,
           default: ('default' in prop ? prop.default as string : '') || "",
</code_context>

<issue_to_address>
**suggestion:** Only 'readonly' modifier is considered; other possible modifiers are ignored.

Consider updating the logic to include other relevant modifiers, such as 'static' and 'private', for more complete documentation.

```suggestion
          modifiers: [
            ('readonly' in prop && prop.readonly ? 'readonly' : ''),
            ('static' in prop && prop.static ? 'static' : ''),
            ('private' in prop && prop.private ? 'private' : '')
          ].filter(Boolean).join(' '),
```
</issue_to_address>

### Comment 2
<location> `src/scripts/docs/docs-generator.ts:396-399` </location>
<code_context>

     // Fallback to string representation
-    return String(type);
+    const result = String(type);
+    
+    // Normalize all | separators to have spaces
+    return result.replace(/\s*\|\s*/g, ' | ');
   }

</code_context>

<issue_to_address>
**suggestion:** Fallback type stringification may produce non-informative output for complex objects.

For objects with nested properties, consider implementing a fallback that serializes or extracts key details, rather than relying on String(type), which returns '[object Object]'.
</issue_to_address>

### Comment 3
<location> `src/scripts/check-commits/commit-analyzer.ts:53-63` </location>
<code_context>
+        let formattedLine = line;
+        
+        // Add spaces before issue references like AlaskaAirlines/auro-cli#108
+        formattedLine = formattedLine.replace(
+          /([^\s])(AlaskaAirlines\/[a-zA-Z0-9-]+#\d+)/g, 
+          '$1 $2'
+        );
+        
+        // Add spaces between consecutive issue references
</code_context>

<issue_to_address>
**suggestion:** Regex for issue references may not cover all possible repository name formats.

Consider updating the regex to include underscores and other valid characters in repository names to ensure all references are matched.

```suggestion
        // Add spaces before issue references like AlaskaAirlines/auro-cli#108
        formattedLine = formattedLine.replace(
          /([^\s])(AlaskaAirlines\/[a-zA-Z0-9._-]+#\d+)/g, 
          '$1 $2'
        );

        // Add spaces between consecutive issue references
        formattedLine = formattedLine.replace(
          /(AlaskaAirlines\/[a-zA-Z0-9._-]+#\d+)([^\s])/g, 
          '$1 $2'
        );
```
</issue_to_address>

### Comment 4
<location> `src/scripts/syncDotGithubDir.ts:195` </location>
<code_context>
-  }
-
-  // Remove .github directory if it exists
-  const githubPath = ".github";
-
-  try {
</code_context>

<issue_to_address>
**suggestion:** Hardcoded .github path may not work if rootDir is not the current working directory.

Use path.join(rootDir, '.github') to construct the directory path, ensuring compatibility regardless of the current working directory.

Suggested implementation:

```typescript
import path from "path";

/**
 * Remove the .github directory inside the specified rootDir.
 */
export async function syncDotGithubDir(rootDir: string, ref = 'main') {

```

```typescript
  // Remove .github directory if it exists
  const dirPath = path.join(rootDir, ".github");

  try {
    await fs.rm(dirPath, { recursive: true, force: true });
    const successSpinner = ora().start();
    successSpinner.succeed(`Successfully removed directory: ${dirPath}`);
  } catch (error: any) {
    const errorSpinner = ora().start();
    errorSpinner.fail(`Error removing directory ${dirPath}: ${error.message}`);
    throw error;
  }
}

```
</issue_to_address>

### Comment 5
<location> `src/commands/sync.js:10` </location>
<code_context>

 export default program
   .command("sync")
+  .option("-r, --ref <branch/tag/commit>", "Git reference (branch/tag/commit) to use", "main")
   .description(
     "Script runner to synchronize local repository configuration files",
</code_context>

<issue_to_address>
**suggestion:** Default ref is set to 'main', which may not exist in all repositories.

If the repository's default branch is not 'main', this may lead to errors. Allow users to specify the branch or detect the default automatically.

Suggested implementation:

```javascript
  .option("-r, --ref <branch/tag/commit>", "Git reference (branch/tag/commit) to use")

```

```javascript
  .action(async (options) => {
    Logger.info("Synchronizing repository configuration files...");

    const cwd = process.cwd();

    // Determine ref: use user input or detect default branch
    let ref = options.ref;
    if (!ref) {
      const { execSync } = await import("child_process");
      try {
        // This returns something like: "refs/remotes/origin/main"
        const symbolicRef = execSync(
          "git symbolic-ref refs/remotes/origin/HEAD",
          { cwd, encoding: "utf8" }
        ).trim();
        ref = symbolicRef.split("/").pop(); // Get the branch name
        Logger.info(`No ref provided, using repository default branch: ${ref}`);
      } catch (err) {
        Logger.error("Could not detect default branch. Please specify --ref.");
        process.exit(1);
      }
    }

    // Use `ref` variable in the rest of your sync logic

```
</issue_to_address>

### Comment 6
<location> `src/utils/pathUtils.js:29` </location>
<code_context>
+  
 export const configPath = (file) => fromCliRoot("configs",file)
+
+export const migrationPath = (path) => fromCliRoot("migrations",path)
</code_context>

<issue_to_address>
**nitpick:** Parameter name 'path' may shadow the imported 'path' module.

Consider renaming the parameter to prevent confusion and possible bugs from shadowing the imported module.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/scripts/docs/docs-generator.ts
Comment thread src/scripts/docs/docs-generator.ts
Comment thread src/scripts/check-commits/commit-analyzer.ts
Comment thread src/commands/sync.js
Comment thread src/utils/pathUtils.js
Comment thread src/scripts/ado/index.ts Dismissed
@rmenner
rmenner merged commit b2546e9 into main Nov 7, 2025
15 checks passed
@rmenner
rmenner deleted the rc/224 branch November 7, 2025 22:28
@jason-capsule42

Copy link
Copy Markdown
Member

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jason-capsule42 jason-capsule42 added the released Completed work has been released label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Completed work has been released semantic-status: feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RC 2025-11-07

4 participants