-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Migrate CLA Process #13651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lukemckinstry
wants to merge
12
commits into
main
Choose a base branch
from
migrate-cla
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+266
−39
Open
Migrate CLA Process #13651
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f649763
setup sharepoint lookup
lukemckinstry ff89bc1
add microsoft cla forms
lukemckinstry 896192f
add credential rotation reminder cron job
lukemckinstry 3d370f9
update cla form links
lukemckinstry 9691f20
update git ignore
lukemckinstry e2dbd07
Merge branch 'main' into migrate-cla
ggetz 60b739d
Update .github/actions/check-for-CLA/index.js
lukemckinstry 53dbea4
throw error when env var is missing
lukemckinstry b2a6bd0
add readme
lukemckinstry 347cb79
link cla ref docs in rotation reminder workflow
lukemckinstry 3a1f7aa
prettier
lukemckinstry 7ac32c9
Edits for brevity, clarity
ggetz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # CLA Check Automation | ||
|
|
||
| This document explains the [Contributor License Agreement (CLA)](../../../CONTRIBUTING.md#contributor-license-agreement-cla) automation process used by CesiumJS CI. | ||
|
|
||
| It covers: | ||
|
|
||
| - the general CLA architecture, | ||
| - when to update credentials, | ||
| - and where maintainers can access the required credentials. | ||
|
|
||
| ## CLA Process Overview | ||
|
|
||
| When a pull request is opened, the CLA workflow runs and checks whether the PR author has a signed CLA on file. | ||
|
|
||
| - **Workflow**: [`.github/workflows/cla.yml`](../../workflows/cla.yml) | ||
| - **Script**: [`.github/actions/check-for-CLA/index.js`](./index.js) | ||
|
|
||
| The script looks up the GitHub username in Microsoft-hosted CLA data and then: | ||
|
|
||
| - posts a confirmation comment when a CLA is found, or | ||
| - posts CLA instructions and applies `PR - Needs Signed CLA` when a CLA is not found. | ||
|
|
||
| ## Architecture Summary | ||
|
|
||
| ### SharePoint Resources | ||
|
|
||
| ```text | ||
| ┌──────────────────┐ ┌──────────────────┐ ┌─────────────────────────┐ | ||
| │ Microsoft Forms │ ───> │ Power Automate │ ───> │ Excel Workbook │ | ||
| │ Survey │ │ Flow │ │ (SharePoint) │ | ||
| └──────────────────┘ └──────────────────┘ └─────────────────────────┘ | ||
| ``` | ||
|
|
||
| We use a **dedicated service account**, `cesium-cla-automation@bentley.com`, as the owner for both: | ||
|
|
||
| 1. [Microsoft Forms surveys](https://forms.office.com/) | ||
| 2. [Power Automate flow](https://make.powerautomate.com/) | ||
|
|
||
| CLA data is stored in [Excel workbooks in OneDrive/SharePoint](https://bentley.sharepoint.com/:f:/r/sites/Platform/Shared%20Documents/CLAs) | ||
|
|
||
| - Platform members and visitors can **view** | ||
| - Limited teams/users (eg. CesiumJS and Cesium Native maintainers) can **edit** | ||
|
|
||
| #### Power Automate Flow behavior | ||
|
|
||
| 1. Trigger: _When a new response is submitted_ | ||
| 2. Action: _Get response details_ | ||
| 3. Action: _Add a row into a table (Excel Online Business)_ | ||
|
|
||
| ### GitHub Actions Script Access to SharePoint Resources | ||
|
|
||
| ```text | ||
| ┌──────────────────┐ ┌──────────────────┐ ┌─────────────────────────┐ | ||
| │ GitHub Actions │ ───> │ Microsoft Graph │ ───> │ Excel Workbook │ | ||
| │ │ │ API │ │ (Microsoft SharePoint) │ | ||
| └──────────────────┘ └──────────────────┘ └─────────────────────────┘ | ||
| ``` | ||
|
|
||
| The CI script accesses SharePoint data via the [Microsoft Graph REST API](https://learn.microsoft.com/en-us/graph/) using a Microsoft Entra app registration. The app credentials and workbook metadata are configured in a JSON string stored in a [GitHub Actions secret](https://github.com/CesiumGS/cesium/settings/secrets/actions). | ||
|
|
||
| `MICROSOFT_GRAPH_INFO_JSON` contains the values required for Graph auth and workbook lookups, including: | ||
|
|
||
| - `tenantId` | ||
| - `clientId` | ||
| - `clientSecret` | ||
| - `siteId` | ||
| - `driveId` | ||
| - `individualWorkbookItemId` | ||
| - `individualTableName` | ||
| - `individualColumnName` | ||
| - `corporateWorkbookItemId` | ||
| - `corporateTableName` | ||
| - `corporateColumnName` | ||
|
|
||
| If a Sharepoint resource is migrated to a new location, or a workbook table or column name changes, `MICROSOFT_GRAPH_INFO_JSON` and [`.github/actions/check-for-CLA/index.js`](./index.js) must be updated to reflect changes. | ||
|
|
||
| ## Accessing Credentials | ||
|
|
||
| Credential access is limited to maintainers with appropriate permissions. | ||
|
|
||
| - **GitHub Actions secrets**: Accessable by users with the CesiumJS **maintainer** role in [**Repository settings / Actions secrets and variables**](https://github.com/CesiumGS/cesium/settings/secrets/actions). Backup copies are stored in Bitwarden. | ||
| - **Sharepoint access**: Credentials are shared in Bitwarden. | ||
| - Dedicated service account for Forms/Flow ownership: `cesium-cla-automation@bentley.com` | ||
| - Graph credential entry: `CLA Automation - Microsoft Graph Credentials for GitHub CI` | ||
|
|
||
| ## Updating Credentials | ||
|
|
||
| Entra app access credentials are configured to expire after one year. A yearly reminder workflow, [`.github/workflows/cla-rotation-reminder.yml`](../../workflows/cla-rotation-reminder.yml) creates a tracking issue on July 1. | ||
|
|
||
| Follow process outlined in the issue to rotate the client secret in the Entra app: | ||
|
|
||
| 1. File a request with Bentley IT to rotate the client secret in the Entra app. Request token expiration be set to **August 1 the following year**. | ||
| 2. Update the value of `MICROSOFT_GRAPH_INFO_JSON` in GitHub Actions secrets. | ||
| 3. (Optional) Open a test PR or re-run the CLA workflow to validate behavior. | ||
| - Verify signed users are recognized. | ||
| - Verify unsigned users receive CLA instructions and label. | ||
| 4. Confirm backup credentials in Bitwarden are current. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: "CLA credential rotation reminder" | ||
|
|
||
| on: | ||
| schedule: | ||
| # 12:00 UTC on July 1 every year | ||
| - cron: "0 12 1 7 *" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| create-rotation-issue: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| steps: | ||
| - name: Create annual CLA rotation issue | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| const year = new Date().getUTCFullYear(); | ||
| const title = `Rotate CLA workflow credentials for ${year}`; | ||
| const label = "priority - next release"; | ||
|
|
||
| const { data: issues } = await github.rest.issues.listForRepo({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: "open", | ||
| per_page: 100, | ||
| }); | ||
|
|
||
| const alreadyExists = issues.some((issue) => issue.title === title); | ||
| if (alreadyExists) { | ||
| core.info(`Issue already exists: ${title}`); | ||
| return; | ||
| } | ||
|
|
||
| const body = [ | ||
| "## Annual CLA workflow credential rotation", | ||
| "", | ||
| "Rotate the Microsoft Graph credentials used by the CLA check workflow (`.github/workflows/cla.yml`).", | ||
| "Reference documentation: `.github/actions/check-for-CLA/README.md`", | ||
| "https://github.com/CesiumGS/cesium/blob/main/.github/actions/check-for-CLA/README.md", | ||
| "", | ||
| "### Checklist", | ||
| "- [ ] Rotate Azure app client secret used by `MICROSOFT_GRAPH_INFO_JSON`", | ||
| "- [ ] Update `MICROSOFT_GRAPH_INFO_JSON` GitHub secret with new credential values", | ||
| "- [ ] Validate `.github/actions/check-for-CLA/index.js` runs successfully in CI", | ||
| "- [ ] Confirm new PRs receive CLA check comment/label behavior", | ||
| "", | ||
| "_Created automatically on July 1._", | ||
| ].join("\n"); | ||
|
|
||
| await github.rest.issues.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| title, | ||
| body, | ||
| labels: [label], | ||
| }); | ||
| core.info(`Created issue with label: ${label}`); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.