Skip to content

diff tool for kiota dom exports which validates public API changes during generation

License

Notifications You must be signed in to change notification settings

microsoftgraph/kiota-dom-export-diff-tool

Repository files navigation

Kiota DOM export diff tool

This tool set is used by the Microsoft Graph Developer Experience team to automate validation of source breaking changes on pre-packaged service libraries. It is not meant for public consumption or use in any other context.

Structure

The tool set is composed of multiple GitHub actions:

  • Export: creates a diff for the DOM export file.
  • Tool: analyzes the diff and provide a success/fail depending on whether source breaking changes are detected. Also provides an "explanation" of the changes.
  • Comment: adds a comment to the pull request, and removes any previously added comment if any.

Example workflow

name: Validate Public API surface changes

on:
  workflow_dispatch:
  push:
  pull_request:
    branches: [ 'feature/*', 'dev' ,'master' ]

permissions:
  contents: read
  pull-requests: write
  issues: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: microsoftgraph/kiota-dom-export-diff-tool/export@main
        id: generatePatch
      - uses: microsoftgraph/kiota-dom-export-diff-tool/tool@main
        if: ${{ steps.generatePatch.outputs.patchFilePath != '' }}
        with:
          path: ${{ steps.generatePatch.outputs.patchFilePath }}
          fail-on-removal: true
        id: diff
      - uses: microsoftgraph/kiota-dom-export-diff-tool/comment@main
        if: ${{ always() && steps.generatePatch.outputs.patchFilePath != '' && steps.diff.outputs.hasExplanations != '' && github.event_name == 'pull_request' }}
        continue-on-error: true
        with:
          comment: ${{ steps.diff.outputs.explanationsFilePath }}
          prNumber: ${{ github.event.pull_request.number }}
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Upload patch file as artifact
        if: always()
        uses: actions/upload-artifact@v4
        continue-on-error: true
        with:
          name: patch
          path: '*.patch'
      - name: Upload explanations file as artifact
        if: always()
        uses: actions/upload-artifact@v4
        continue-on-error: true
        with:
          name: explanations
          path: 'explanations.txt'

About

diff tool for kiota dom exports which validates public API changes during generation

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published