Skip to content

Commit 1c9103a

Browse files
khatchadclaude
andauthored
Add CodeQL workflow; document CI release flow as the process (not a prototype) (#55)
- Add .github/workflows/codeql.yml: static analysis for GitHub Actions and Java (Tycho build, no tests), matching the org's CodeQL setup. - Reframe docs/RELEASING.md around the CI->Pages composite flow as the actual release process (it shipped v5.4.0), with the committed update site marked legacy; drop "prototype" wording from release.yml too. Claude-Session: https://claude.ai/code/session_015krtPy49YGqBERvq4yDjCa Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ca049a1 commit 1c9103a

3 files changed

Lines changed: 78 additions & 33 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CodeQL
2+
3+
# Static security analysis. Scans GitHub Actions workflows and the Java code.
4+
# The Java analysis builds with Tycho (autobuild can't resolve the target
5+
# platform), mirroring maven.yml's install step minus tests.
6+
7+
on:
8+
push:
9+
branches: [master]
10+
pull_request:
11+
branches: [master]
12+
schedule:
13+
- cron: "0 6 * * 1"
14+
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
jobs:
21+
analyze:
22+
name: Analyze (${{ matrix.language }})
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 60
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
language: [actions, java-kotlin]
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
34+
- if: matrix.language == 'java-kotlin'
35+
uses: actions/setup-java@v4
36+
with:
37+
distribution: temurin
38+
java-version: "21"
39+
cache: maven
40+
41+
- uses: github/codeql-action/init@v3
42+
with:
43+
languages: ${{ matrix.language }}
44+
45+
- if: matrix.language == 'java-kotlin'
46+
name: Build with Maven (no tests)
47+
run: ./mvnw -U -DtrimStackTrace=true -Dtycho.showEclipseLog=true -DskipTests install -B
48+
49+
- uses: github/codeql-action/analyze@v3
50+
with:
51+
category: "/language:${{ matrix.language }}"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release (CI-published p2 site)
22

3-
# PROTOTYPE of a CI-published release flow that replaces the in-repo,
4-
# cumulative, hand-assembled P2 update site (see docs/RELEASING.md).
3+
# CI-published release flow that replaces the legacy in-repo, cumulative,
4+
# hand-assembled P2 update site (see docs/RELEASING.md).
55
#
66
# What it does, on manual dispatch:
77
# 1. set the release version, build + test (Tycho), producing a complete

docs/RELEASING.md

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,42 @@
11
# Releasing
22

3-
This repo has two release mechanisms. The **current** one is in-repo and manual/scripted; the **prototype** one is CI-published. This document compares them so we can decide whether to migrate.
3+
Releases are built in CI and published to GitHub Pages as a p2 composite repository. The older in-repo committed update site is **legacy** and is being retired.
44

5-
## Current Model (`release.sh`, Committed Update Site)
5+
## How to Cut a Release
66

7-
The P2 update site lives **inside the source repo** (`edu.cuny.citytech.refactoring.common.updatesite/`) and is **cumulative**: every release commits its feature + plugin jars and rewrites the shared `artifacts.jar`/`content.jar` index, served from `raw.githubusercontent.com/.../updatesite`.
7+
Run the **Release** workflow: GitHub → Actions → "Release (CI-published p2 site)" → Run workflow, and enter the release version (e.g. `5.4.0`). It will set the version, build and test, tag `vX.Y.Z`, create a GitHub Release (with the p2 repo attached as a zip), publish the per-version repo to `gh-pages`, regenerate the composite index, and bump `master` to the next development version. No binaries are committed to `master`.
88

9-
`./release.sh X.Y.Z` automates it: `set-version`→build→stage jars→bump `site.xml`→regenerate the cumulative index with the Eclipse p2 publisher (`-append`)→commit/tag/push→GitHub Release→next-dev bump.
9+
Update-site URL (composite, exposes every released version):
1010

11-
Trade-offs:
11+
```
12+
https://ponder-lab.github.io/Common-Eclipse-Refactoring-Framework/releases/
13+
```
1214

13-
- ➖ Binaries accumulate in `master` history **forever**—every release grows every clone, unrecoverably.
14-
- ➖ Requires a local Eclipse install with the p2 publisher apps; the index is hand-assembled (`-append`), which is fragile (category-id qualification, easy to leak a local path).
15-
-`raw.githubusercontent.com` is not a real artifact host (no CDN/SLA).
16-
- ➕ Zero infra; everything is in one repo; offline-capable.
15+
## How It Works (CI→GitHub Pages Composite Repo)
1716

18-
## Prototype Model (This Branch: CI→GitHub Pages Composite Repo)
17+
The update site is built in CI and published to the `gh-pages` branch, never committed to `master`. Each release publishes its **own** small p2 repo under `releases/X.Y.Z/`, and a p2 **composite repository** at the root ties them all together—so one stable URL exposes every version without a monolithic index.
1918

20-
The update site is **built in CI and published to the `gh-pages` branch**, never committed to `master`. Each release publishes its **own** small p2 repo under `releases/X.Y.Z/`, and a p2 **composite repository** at the root ties them all together—so one stable URL exposes every version without a monolithic index.
19+
Pieces:
2120

22-
Stable update-site URL (composite):
21+
- **`edu.cuny.citytech.refactoring.common.updatesite/category.xml`**—makes Tycho's `eclipse-repository` build produce a **complete** per-version p2 repo at `updatesite/target/repository` (feature + 8 bundles + category); a plain `./mvnw clean install` is enough (no GUI, no p2 publisher, no `-append`).
22+
- **`tools/p2-composite.sh`**—regenerates `compositeContent.xml`/`compositeArtifacts.xml` from the per-version child dirs.
23+
- **`.github/workflows/release.yml`**—the manual-dispatch pipeline described above.
2324

24-
```
25-
https://ponder-lab.github.io/Common-Eclipse-Refactoring-Framework/releases/
26-
```
25+
Properties:
2726

28-
Pieces added on this branch:
27+
- No binaries in `master`—source history stays lean. The published bits live on the orphan `gh-pages` branch, independent of source clones.
28+
- One CLI build produces the repo; no GUI, no hand-assembled index.
29+
- The composite layout scales to any number of versions; each release is an isolated, immutable child.
30+
- The shipped repo always matches what the build compiled against (no dep-vs-site drift).
2931

30-
- **`edu.cuny.citytech.refactoring.common.updatesite/category.xml`**—the key fix. Tycho's `eclipse-repository` build was producing an *empty* repo because the module only had the legacy `site.xml`. With a `category.xml`, a plain `./mvnw clean install` produces a **complete** per-version p2 repo at `updatesite/target/repository` (feature + 8 bundles + category)—no GUI, no p2 publisher, no `-append`.
31-
- **`tools/p2-composite.sh`**—regenerates `compositeContent.xml`/`compositeArtifacts.xml` from the per-version child dirs. (Verified: the Eclipse p2 director loads the composite and resolves the feature.)
32-
- **`.github/workflows/release.yml`**—manual-dispatch pipeline: set-version→build/test→tag + GitHub Release (with the p2 repo zipped as an asset)→publish to `gh-pages` as a composite→next-dev bump.
32+
## Legacy Model (`release.sh`, Committed Update Site)
3333

34-
Trade-offs:
34+
Before the CI flow, the p2 update site lived **inside the source repo** (`edu.cuny.citytech.refactoring.common.updatesite/`) and was **cumulative**: every release committed its feature + plugin jars and rewrote the shared `artifacts.jar`/`content.jar` index, served from `raw.githubusercontent.com/.../updatesite`. `./release.sh X.Y.Z` automated that flow.
3535

36-
-**No binaries in `master`**—source history stays lean. The published bits live on the orphan `gh-pages` branch, independent of source clones.
37-
- ➕ One CLI build produces the repo; no GUI, no hand-assembled index.
38-
- ➕ Composite layout scales to any number of versions; each release is an isolated, immutable child—no risk of corrupting a shared index.
39-
- ➕ Released p2 repo is also attached to the GitHub Release as a zip.
40-
- ➖ Relies on GitHub Pages + Actions (infra, perms).
41-
-`gh-pages` still accumulates binaries, but on a branch you can prune/squash without touching source history.
36+
It is retained only as an offline fallback. Drawbacks that motivated the move: binaries accumulate in `master` history forever (every release grows every clone); it needs a local Eclipse install with the p2 publisher and a fragile hand-assembled (`-append`) index; and `raw.githubusercontent.com` is not a real artifact host.
4237

43-
## Migration Notes (Not Done on This Branch)
38+
## Remaining Cleanup
4439

45-
1. Enable GitHub Pages for the `gh-pages` branch.
46-
2. Update the README's update-site URL to the Pages composite URL.
47-
3. Optionally seed `gh-pages` with the existing historical versions (one child dir per past release) so nothing 404s, then **drop the committed `updatesite/` binaries** from `master` going forward (and, if desired, purge them from history).
48-
4. Retire `release.sh` (or keep as an offline fallback).
40+
1. Drop the committed `updatesite/` binaries from `master` (history is preserved on `gh-pages` under `releases/archive/`).
41+
2. Retire `release.sh` (or keep as an offline fallback).
42+
3. Once confident, remove the legacy `raw.githubusercontent` URL from the README.

0 commit comments

Comments
 (0)