Skip to content

Commit dc3659c

Browse files
committed
Update the release process section
1 parent c13560e commit dc3659c

File tree

1 file changed

+49
-39
lines changed

1 file changed

+49
-39
lines changed

docs/development_handbook.md

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
| 0.26.0 | 2022-08-10 | Remco Vermeulen | Address incorrect package file generation command. This was missing the required language argument. |
3636
| 0.27.0 | 2022-11-08 | Luke Cartey | Update the versions of C we intend to support to exclude C90, which reflects the intended scope at the outset of the project. |
3737
| 0.28.0 | 2023-08-14 | Luke Cartey | Remove references to LGTM which is now a legacy product. |
38+
| 0.29.0 | 2023-10-11 | Remco Vermeulen | Update release process. |
3839

3940
## Scope of work
4041

@@ -515,9 +516,29 @@ To upgrade the CodeQL external dependencies:
515516

516517
### Release process
517518

518-
#### Version Numbering
519+
The release process is a combination of release specific Action workflows and validation Action workflows executed on each PR.
520+
The flowchart below provides an overview of the release process and how the release specific Action workflows are related.
521+
522+
```mermaid
523+
flowchart TD;
524+
prepare-release["Prepare release (prepare-release.yml)"]
525+
validate-release["Validate release (validate-release.yml)"]
526+
compiler-validation["Compiler tests (release-engineering/release-compiler-validation.yml.)"]
527+
performance-testing["Performance testing (release-engineering/release-performance-testing.yml)"]
528+
existing-checks["Existing checks run on each PR"]
529+
update-release["Update release (update-release.yml)"]
530+
finalize-release["Finalize release (finalize-release.yml)"]
531+
532+
prepare-release-->validate-release
533+
validate-release-->compiler-validation-->update-release
534+
validate-release-->performance-testing-->update-release
535+
prepare-release-->existing-checks-->update-release
536+
update-release-->finalize-release
537+
```
538+
539+
#### Version Numbering
519540

520-
Version numbers follow semantic versioning and adhere to the following guidelines specific to Coding Standards.
541+
Version numbers follow semantic versioning and adhere to the following guidelines specific to Coding Standards.
521542

522543
Given the version `<MAJOR>.<MINOR>.<PATCH>`:
523544

@@ -531,57 +552,46 @@ We use the "Releases" feature in GitHub to manage and track our releases. This p
531552

532553
To simplify the process of generating the release information, the repository contains a number of scripts and Action workflows:
533554

534-
- [`generate_release_notes.py`](../scripts/release/generate_release_notes.py) - a script for generating release notes based on the contents of the repository in comparison to the previous release.
535-
- [`create_draft_release.sh`](../scripts/release/create_draft_release.sh) - a script for creating a release by:
536-
1. Downloading the appropriate artifacts
537-
2. Generating the release notes by calling `generate_release_notes.py` with appropriate parameters
538-
3. Generating the list of supported rules
539-
4. Creating a draft release on GitHub containing the artifacts from the previous steps
540-
5. Triggering integration testing on the new release.
541-
- [`create-draft-release.yml`](../.github/workflows/create-draft-release.yml) - a GitHub Actions workflow for running the `create_draft_release.sh` on demand within the CI/CD environment.
555+
- [prepare-release.yml](./github/workflows/prepare-release.yml): The entry point for starting a new release. When provided with a version and a Git reference this workflow will
556+
- Create a release branch.
557+
- Create a release PR that will contain all the changes required for a release and will validate the release using checks.
558+
- Create a draft release that will be updated during various stages of the release.
559+
- [update-release.yml](./github/workflows/update-release.yml): This workflow will update the draft release when all checks have passed successfully on the release PR. The draft release is updated to:
560+
- Have the most recent release notes as generated by the [update-release-notes.py](scripts/release/update-release-notes.py) script.
561+
- Have the most recent release assets as generated by the [update-release-assets.py](scripts/release/update-release-assets.py).
562+
- [finalize-release.yml](.github/workflows/finalize-release.yml): This will update the release tag and mark the release public when the release PR is merged to successfully conclude the release.
563+
- [update-release-status.yml](.github/workflows/update-release-status.yml): This workflow will update the status on the release by monitoring the status of individual validation steps. When all succeeded this will invoke the `update-release.yml` workflow.
564+
- [update-check-run.yml](.github/workflows/update-check-run.yml): Utility workflow that allow authorized external workflows (i.e., workflows in other repositories) to update the status of check runs in the coding standards repository.
565+
- [validate-release.yml](.github/workflows/validate-release.yml): Utility workflow that will start the performance and compiler compatibility testing that are orchestrated from the codeql-coding-standards-release-engineering repository.
542566

543567
#### Branching workflow
544568

545-
Each new major or minor release should have a dedicated release branch, with the name `rc/<major>.<minor>`. A new patch version should re-use the existing release branch for the release that is being patched.
569+
Each release should have a dedicated release branch, with the name `rc/<major>.<minor>.<patch>`. A new patch version should branch from the existing release branch for the release that is being patched.
546570
Ensure that the same release branch is created in the [codeql-coding-standards-help](https://github.com/github/codeql-coding-standards-help) repository.
547571

548-
#### Artifact creation
572+
#### Release assets
549573

550-
There is an automated CI/CD job ([Code Scanning Query Pack Generation](../.github/workflows/code-scanning-pack-gen.yml)) provided that generates the following release artifacts for Coding Standards:
574+
There is an automated CI/CD job ([Update Release](../.github/workflows/update-release.yml)) that will automatically generate the release assets according to the [release layout specification](scripts/release/release-layout.yml).
575+
Among the assets are:
551576

552-
- Code Scanning query pack - generates a zipped folder that can be used with the CodeQL CLI directly, or with GitHub Advanced Security.
577+
- Certification kit containing the proof obligations for ISO26262 certification.
578+
- Code Scanning query packs that can be used with the CodeQL CLI directly, or with GitHub Advanced Security.
553579

554580
**Use of Code Scanning within GitHub Advanced Security is not in scope for ISO 26262 tool qualification. See [user_manual.md#github-advanced-security](user_manual.md#github-advanced-security) for more information**.
555581

556-
These run on every push to `main` and `rc/*`, and on every pull request, and are releasable without modification, assuming all other status checks succeed on the same commit.
557-
558582
#### Creating a release
559583

560584
To create a new release:
561-
1. Create an internal "release checklist" issue.
562-
2. Determine the appropriate release version. Version numbers are generated
585+
586+
1. Determine the appropriate release version. Version numbers are generated
563587
according to the guidelines in the section "Version Numbering."
564-
3. If a new `MAJOR` version is necessary, create a new `rc/<MAJOR>.0` branch off of `main`. Otherwise, reuse the existing `rc` branch and merge work from `main` into the `rc` branch you have selected.
565-
4. Ensure the same `rc` branch exists in the [codeql-coding-standards-help](https://github.com/github/codeql-coding-standards-help) repository. This branch will be used to include external help files.
566-
5. Submit a PR to update the `qlpack.yml` version numbers on the `main` branch to the next anticipated release.
567-
6. Submit a PR to update the `qlpack.yml` version numbers on the release branch to the new version.
568-
7. Trigger a [workflow dispatch event](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) for the [Create draft release](../.github/workflows/create-draft-release.yml) workflow, specifying the release branch. The output of this workflow should report a link to the draft release and a link to the integration testing workflow triggered for this release.
569-
- In the event the workflow is unusable, the [`create_draft_release.sh`](../scripts/release/create_draft_release.sh) script can be run directly on a local machine.
570-
8. Run the following workflows with the new version number, e.g., `v2.0.0`:
571-
- [Test Linux/x86_64](https://github.com/github/codeql-coding-standards-release-engineering/actions/workflows/test-release-performance-linux-x86_64.yml)
572-
- [Test Windows/x86_64](https://github.com/github/codeql-coding-standards-release-engineering/actions/workflows/test-release-performance-windows-x86_64.yml)
573-
- [Regenerate Performance Views](https://github.com/github/codeql-coding-standards-release-engineering/actions/workflows/regenerate-performance-views.yml)
574-
9. Confirm the integration testing workflow completes successfully, and that the execution time is comparable to previous releases, taking into account that the execution time is expected to increase proportionally as more queries are added for each release. Results may be viewed on the release engineering repo: https://github.com/github/codeql-coding-standards-release-engineering
575-
10. For release 1.0.0 and above, the integration testing results must be verified. For each "integration testing codebase":
576-
- Download the SARIF result file
577-
- Compare the results against the previously computed set of results for that integration testing codebase, and, for any new or changed results, spot check to confirm validity.
578-
- For false positives and false negatives identified during this process issues should be opened on this repository to track the problems identified.
579-
- For each issue opened, assess whether they are "significant" i.e. whether they are likely to cause problems in practice with customers. If so, consider Step 7. failed.
580-
11. If the release fails steps 7. or 8. (if applicable), retain the draft release, and rename it to `vminor.major.patch-rc<count>`. Address the release blocking issues on the `rc/<major>.<minor>` branch, and restart the release process at Step 7.
581-
12. If steps 7. and 8. (if applicable) succeeded, then the release can be marked as "published".
582-
13. Release artifacts can now be distributed to customers.
583-
14. Create an internal "release retrospective" issue, and document any pain points or other issues.
584-
15. Create a PR that merges the release candidate branch into `main`.
588+
2. Determine the appropriate [Git reference](https://git-scm.com/book/en/v2/Git-Internals-Git-References) to base the new release on. For new major or minor releases, this will be `main`. For patch releases this will be the release branch that is patched.
589+
3. Trigger a [workflow dispatch event](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) for the [Prepare CodeQL Coding Standards release](../.github/workflows/prepare-release.yml) workflow, specifying the release version for the input `version` and the Git reference for the input `ref`.
590+
4. Merge the PR that is created for the release, named `Release v<major>.<minor>.<patch>` where `<major>`, `<minor>`, and `<patch>` match with the input `version` of the workflow [Prepare CodeQL Coding Standards release](../.github/workflows/prepare-release.yml) triggered in the previous step.
591+
592+
The release automation consists of many test and validation steps that can fail. These can be addressed and the release can be restarted from step 3.
593+
A restart of a release **WILL RECREATE THE EXISTING RELEASE BRANCH AND RELEASE PR**. Any additional changes added to the PR **MUST** be reapplied.
594+
If a release has been marked public, the release can no longer be restarted or re-released without removing the release manually.
585595

586596
## False Positive Triage Rubric
587597

0 commit comments

Comments
 (0)