Skip to content

fix(tickets): search works together with the activity filter CU-17tkuw6c8t6 #2822

fix(tickets): search works together with the activity filter CU-17tkuw6c8t6

fix(tickets): search works together with the activity filter CU-17tkuw6c8t6 #2822

Workflow file for this run

name: OpenFrame OSS Libs Build
permissions:
contents: read
pull-requests: read
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened, labeled, closed]
branches: [main]
merge_group:
# Saves the Rust cache that pull requests and the merge queue restore.
push:
branches: [main]
concurrency:
# By event and commit, so a push run cancels neither the merge-queue run of its commit nor the previous push's cache save.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
REGISTRY: "com.openframe.oss"
ORGANISATION: ${{ github.repository_owner }}
REPOSITORY: "com/openframe/oss/${{ github.event.repository.name }}"
# =============================================================================
# JOBS
# =============================================================================
jobs:
changes:
name: Changes
uses: ./.github/workflows/changes.yaml
# PR builds (and snapshots) only with the build label; the merge queue and main always build.
if: github.event_name != 'pull_request' || (github.event.pull_request.state == 'open' && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build'))
build-java:
name: Build Java
runs-on: ubuntu-latest
needs: [changes]
if: github.event_name != 'push' && fromJSON(needs.changes.outputs.changes || '{}').java == 'true'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
- name: Cache Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
# Merge queue only builds and tests; snapshots are published per PR.
- name: Resolve PR Snapshot Version
if: github.event_name == 'pull_request'
shell: bash # pipefail: a failed lookup must fail, not publish .1-<PR>-SNAPSHOT
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
URL="https://maven.pkg.github.com/${{ github.repository }}/${{ env.REPOSITORY }}/maven-metadata.xml"
OLD_VERSION=$(curl -sf -H "Authorization: token $GITHUB_TOKEN" "$URL" |
grep -oP '<version>\K[0-9]+\.[0-9]+\.[0-9]+(?=</version>)' | sort -V | tail -1)
echo "NEW_VERSION=${OLD_VERSION%.*}.$((${OLD_VERSION##*.} + 1))-${{ github.event.pull_request.number }}-SNAPSHOT" >> "$GITHUB_ENV"
- name: Build and Publish ${{ env.NEW_VERSION }}
id: build
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
mvn clean ${{ github.event_name == 'merge_group' && 'verify' || 'deploy' }} \
${NEW_VERSION:+-Drevision="$NEW_VERSION"} \
-s .mvn/settings.xml \
--threads 2C \
--batch-mode \
--no-transfer-progress \
-Dmaven.source.skip=true
build-node:
name: Build Node (openframe-frontend-core)
runs-on: ubuntu-latest
needs: [changes]
if: github.event_name != 'push' && fromJSON(needs.changes.outputs.changes || '{}')['openframe-frontend-core'] == 'true'
# npm's defaults allow 970s of silence per hung registry socket; these bound it to 115s
env:
NPM_CONFIG_FETCH_TIMEOUT: 30000
NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT: 15000
NPM_CONFIG_LOGLEVEL: http
defaults:
run:
shell: bash
working-directory: openframe-frontend-core
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
# The committed lockfile is what every install reads, so the cache keys on it.
cache: npm
cache-dependency-path: openframe-frontend-core/package-lock.json
# The npm version the lockfile is maintained with.
- name: Upgrade npm
run: npm install -g npm@11.9.0
# Exactly the committed lockfile, as every developer's checkout has it; fails when package.json and the lockfile disagree.
- name: Install Dependencies
run: npm ci
# ~1s; a broken eslint config makes every lint result below meaningless.
# Disabled: covered by "Flamingo Code Review / tests and checks" (npm run lint:config-smoke in openframe-frontend-core). Kept here, not deleted: the repository variable FLAMINGO_LEGACY_CHECKS=on runs it again. CU-17tkuw60a9u
- name: Lint Config Smoke
if: vars.FLAMINGO_LEGACY_CHECKS == 'on'
run: npm run lint:config-smoke
# Disabled: covered by "Flamingo Code Review / tests and checks" (npm run type-check in openframe-frontend-core). Kept here, not deleted: the repository variable FLAMINGO_LEGACY_CHECKS=on runs it again. CU-17tkuw60a9u
- name: Type Check
if: vars.FLAMINGO_LEGACY_CHECKS == 'on'
run: npm run type-check
# Disabled: covered by "Flamingo Code Review / tests and checks" (npm run lint in openframe-frontend-core). Kept here, not deleted: the repository variable FLAMINGO_LEGACY_CHECKS=on runs it again. CU-17tkuw60a9u
- name: Lint
if: vars.FLAMINGO_LEGACY_CHECKS == 'on'
run: npm run lint
# Needs a TypeScript program and an 8 GB heap; the slowest check, so kept apart.
# Disabled: covered by "Flamingo Code Review / tests and checks" (npm run lint:types in openframe-frontend-core). Kept here, not deleted: the repository variable FLAMINGO_LEGACY_CHECKS=on runs it again. CU-17tkuw60a9u
- name: Lint (type-aware)
if: vars.FLAMINGO_LEGACY_CHECKS == 'on'
run: npm run lint:types
- name: Format
run: npm run format
# The chat wire and the record-link vectors are the hub's contracts, read from the hub that serves them
# (chat-protocol/__fixtures__/hub-contracts.ts). With the secret they are required; a fork's pull request has none,
# so they are skipped there. FLAMINGO_HUB_CONTRACTS_URL points them at a hub preview before its contracts reach
# production.
- name: Test
env:
FLAMINGO_HUB_BASE_URL: ${{ secrets.FLAMINGO_HUB_SECRET != '' && (vars.FLAMINGO_HUB_CONTRACTS_URL || vars.FLAMINGO_HUB_BASE_URL) || '' }}
FLAMINGO_HUB_SECRET: ${{ secrets.FLAMINGO_HUB_SECRET }}
FLAMINGO_HUB_CONTRACTS_REQUIRED: ${{ secrets.FLAMINGO_HUB_SECRET != '' && '1' || '' }}
run: npm run test:run
- name: Build
run: npm run build
# No local (file:/link:/.yalc) specs may reach the registry - see the script.
- name: Check publish manifest
run: node scripts/check-publish-manifest.mjs package.json
# --ignore-scripts skips a prepack rebuild.
- name: Pack
if: github.event_name == 'pull_request'
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
OLD_VERSION=$(git ls-remote --tags --refs origin | cut -d/ -f3 | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
npm version "${OLD_VERSION%.*}.$((${OLD_VERSION##*.} + 1))-${{ github.event.pull_request.number }}.${{ github.run_number }}.${{ github.run_attempt }}" --no-git-tag-version
echo "PACKAGE_TARBALL=$PWD/$(npm pack --ignore-scripts --json | jq -r '.[0].filename')" >> "$GITHUB_ENV"
echo "SHORT_SHA=${HEAD_SHA::7}" >> "$GITHUB_ENV"
# PR builds go to pkg.pr.new only.
- name: Preview registry (pkg.pr.new) @${{ env.SHORT_SHA }} (@${{ github.event.pull_request.number }} tag)
if: github.event_name == 'pull_request'
run: |
npm exec --no -- pkg-pr-new publish --no-compact --no-template --comment=off --json pkg-pr-new.json "$PACKAGE_TARBALL"
jq -r '.packages[0].url' pkg-pr-new.json >> "$GITHUB_STEP_SUMMARY"
build-rust:
name: "Build Rust (${{ matrix.os }})"
needs: changes
if: fromJSON(needs.changes.outputs.changes || '{}').rust == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
defaults:
run:
shell: bash
env:
OPENFRAME_VERSION: 0.0.0-dev
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
- name: Prepare Rust tools
uses: ./.github/steps/rust-setup
with:
path: clients/openframe-client
components: clippy,rustfmt
shared-key: openframe-client-${{ matrix.os }}
- name: Lint (cargo fmt --check + cargo clippy -D warnings)
run: make -C clients/openframe-client lint
- name: Build client binary
run: make -C clients/openframe-client build-bin
- name: Install nats-server
env:
NATS_SERVER_VERSION: v2.10.29
run: |
cd "$RUNNER_TEMP"
base="https://github.com/nats-io/nats-server/releases/download/$NATS_SERVER_VERSION"
case "$RUNNER_OS" in
macOS)
dir="nats-server-$NATS_SERVER_VERSION-darwin-arm64"
curl -fsSLo "$dir.tar.gz" "$base/$dir.tar.gz"
echo "d7d8277882679d072c12f200c7b7006ee19aece00d2a0d75c3fbf2bf7fbd08ba $dir.tar.gz" | shasum -a 256 -c -
tar -xzf "$dir.tar.gz"
;;
Windows)
dir="nats-server-$NATS_SERVER_VERSION-windows-amd64"
curl -fsSLo "$dir.zip" "$base/$dir.zip"
echo "98657bf4d5a9ce44168c019ba6894cda8e22e6adc8798edc05c168db7262de29 $dir.zip" | sha256sum -c -
unzip -q "$dir.zip"
;;
esac
echo "$RUNNER_TEMP/$dir" >> "$GITHUB_PATH"
- name: Test
env:
REQUIRE_NATS_SERVER: "1"
run: make -C clients/openframe-client test
build-rust-common:
name: "Build Rust common (${{ matrix.os }})"
needs: changes
if: fromJSON(needs.changes.outputs.changes || '{}').rust == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
cross-target: x86_64-apple-darwin
- os: windows-latest
cross-target: aarch64-pc-windows-msvc
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Prepare Rust tools
uses: ./.github/steps/rust-setup
with:
path: clients/openframe-common
targets: ${{ matrix.cross-target }}
components: clippy,rustfmt
shared-key: openframe-common-${{ matrix.os }}
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack@0.6.46
fallback: none
- name: Lint (cargo fmt --check + cargo clippy -D warnings)
run: make -C clients/openframe-common lint
- name: Check every feature combination
run: make -C clients/openframe-common hack
- name: Clippy for ${{ matrix.cross-target }}
run: make -C clients/openframe-common cross TARGET=${{ matrix.cross-target }}
- name: Test
run: make -C clients/openframe-common test
cleanup:
name: Cleanup
if: github.event_name == 'pull_request' && github.event.pull_request.state != 'open'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
# One package's API error (a 504 left 40 of 48 with snapshots) must not stop the rest; fails at the end so a re-run finishes it.
- name: Delete PR ${{ github.event.pull_request.number }} java snapshots
shell: bash
env:
GH_TOKEN: ${{ github.token }}
SUFFIX: -${{ github.event.pull_request.number }}-SNAPSHOT
run: |
PKGS=$(gh api "/orgs/${{ env.ORGANISATION }}/packages?package_type=maven" --paginate \
--jq '.[] | select(.name | startswith("${{ env.REGISTRY }}.")) | .name')
FAILED=0
for PKG in $PKGS; do
gh api "/orgs/${{ env.ORGANISATION }}/packages/maven/$PKG/versions" --paginate \
--jq "[.[] | select(.name | endswith(\"$SUFFIX\"))] | .[].id" |
xargs -r -I{} gh api --silent -X DELETE "/orgs/${{ env.ORGANISATION }}/packages/maven/$PKG/versions/{}" ||
{ echo "::warning::$PKG: snapshot cleanup failed"; FAILED=1; }
done
exit $FAILED