Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# Vajra Copilot Instructions

For implementation work in this repository, follow these rules first. Use
`.github/instructions/review.instructions.md` as supplemental review guidance,
not as the primary coding file.
For implementation work in this repository, follow these rules first. Use `.github/instructions/review.instructions.md` as supplemental review guidance, not as the primary coding file.

Detailed rules live in path-specific files under `.github/instructions/`.
Prefer repository instruction files over client-specific config. Use client
config only when a tool is known not to load repository instruction files
reliably.
Detailed rules live in path-specific files under `.github/instructions/`. Prefer repository instruction files over client-specific config. Use client config only when a tool is known not to load repository instruction files reliably.

## Placement

- `gems/vajra` owns the canonical Ruby package, executable, and native
extension bridge.
- `gems/vajra` owns the canonical Ruby package, executable, and native extension bridge.
- Keep native sources under `gems/vajra/ext/vajra/`.
- Put signatures in the mirrored `gems/vajra/sig/` path for every changed Ruby
surface.
- Put signatures in the mirrored `gems/vajra/sig/` path for every changed Ruby surface.

## Structure

Expand All @@ -27,8 +20,7 @@ reliably.

## Implementation

- Trace concrete state changes for time, retries, leases, shutdown, and shared
state.
- Trace concrete state changes for time, retries, leases, shutdown, and shared state.
- Validate raw input before normalization when order matters.
- Keep types consistent from input to validation to runtime use.
- Do not symbolize or cache unbounded input.
Expand Down
230 changes: 71 additions & 159 deletions .github/instructions/review.instructions.md

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions .github/instructions/vajra-rbs.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ applyTo: "gems/vajra/sig/**/*.rbs"
# Vajra RBS Instructions

- RBS must stay true to the Ruby implementation it mirrors.
- Keep signatures aligned with ownership, visibility, argument names,
optionality, and return types.
- Keep signatures aligned with ownership, visibility, argument names, optionality, and return types.
- Remove stale signatures when methods or modules move or disappear.
- When Ruby changes under `gems/vajra/lib`, check the mirrored path under
`gems/vajra/sig` in the same change.
- When Ruby changes under `gems/vajra/lib`, check the mirrored path under `gems/vajra/sig` in the same change.
13 changes: 4 additions & 9 deletions .github/instructions/vajra.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ applyTo: "gems/vajra/lib/**/*.rb,gems/vajra/spec/**/*.rb,gems/vajra/exe/**/*,gem
# Vajra Package Instructions

- `gems/vajra` is the canonical runtime package for this repository.
- Keep native-extension ownership explicit: Ruby entrypoints in `lib/`, native
sources in `ext/vajra/`, signatures in `sig/`, and mirrored direct specs in
`spec/`.
- Keep native-extension ownership explicit: Ruby entrypoints in `lib/`, native sources in `ext/vajra/`, signatures in `sig/`, and mirrored direct specs in `spec/`.
- Prefer responsibility-named files over generic helpers or utils.
- Keep package-local commands authoritative. Run validation from `gems/vajra`,
not from the repo root with ad hoc paths.
- Use actionable error messages when boot, build, or native-load behavior
fails.
- Update package docs when commands, layout, or supported development flows
change.
- Keep package-local commands authoritative. Run validation from `gems/vajra`, not from the repo root with ad hoc paths.
- Use actionable error messages when boot, build, or native-load behavior fails.
- Update package docs when commands, layout, or supported development flows change.
17 changes: 5 additions & 12 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
The title of the GitHub must follow the following format:
<type>: Briefly describe the changes made in this pull request.

Supported title prefixes:
feat:, bugfix:, docs:, release:, chore:, refactor:, test:, style:, ci:, perf:, build:

For example:
feat: Add a new feature to the project
bugfix: Fix bug in the project
docs: Update documentation
ci: Update GitHub Actions workflow
build: Update package build configuration

A CLA is required for this pull request. Please read and sign the CLA at https://cla.developers.codevedas.com
-->
Supported title prefixes: feat:, bugfix:, docs:, release:, chore:, refactor:, test:, style:, ci:, perf:, build:

For example: feat: Add a new feature to the project bugfix: Fix bug in the project docs: Update documentation ci: Update GitHub Actions workflow build: Update package build configuration

A CLA is required for this pull request. Please read and sign the CLA at https://cla.developers.codevedas.com -->

# Pull Request

Expand Down
163 changes: 126 additions & 37 deletions .github/workflows/shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,10 @@ on:

jobs:
rubocop:
name: RuboCop · Ruby ${{ matrix.ruby_version }}
name: RuboCop · Ruby 3.4
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.2"
- "3.4"
- "4.0"
steps:
- uses: actions/checkout@v7
- name: Install apt packages
Expand All @@ -46,34 +39,27 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
ruby-version: "3.4"
bundler-cache: false
- name: Restore bundle cache
uses: actions/cache@v6
with:
path: ${{ env.BUNDLE_PATH }}
key: ${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-${{ hashFiles('gems/vajra/Gemfile.lock', 'docs/Gemfile.lock', 'danger/Gemfile.lock') }}
key: ${{ runner.os }}-ruby-3.4-bundle-${{ hashFiles('gems/vajra/Gemfile.lock', 'docs/Gemfile.lock', 'danger/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-
${{ runner.os }}-ruby-3.4-bundle-
- name: Install bundles
run: scripts/ci-install-bundles
env:
CI_RUBY_VERSION: ${{ matrix.ruby_version }}
CI_RUBY_VERSION: "3.4"
- name: Run RuboCop
run: scripts/run-rubocop-all

reek:
name: Reek and RBS · Ruby ${{ matrix.ruby_version }}
name: Reek and RBS · Ruby 3.4
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.2"
- "3.4"
- "4.0"
steps:
- uses: actions/checkout@v7
- name: Install apt packages
Expand All @@ -84,19 +70,19 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
ruby-version: "3.4"
bundler-cache: false
- name: Restore bundle cache
uses: actions/cache@v6
with:
path: ${{ env.BUNDLE_PATH }}
key: ${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-${{ hashFiles('gems/vajra/Gemfile.lock', 'docs/Gemfile.lock', 'danger/Gemfile.lock') }}
key: ${{ runner.os }}-ruby-3.4-bundle-${{ hashFiles('gems/vajra/Gemfile.lock', 'docs/Gemfile.lock', 'danger/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-
${{ runner.os }}-ruby-3.4-bundle-
- name: Install bundles
run: scripts/ci-install-bundles
env:
CI_RUBY_VERSION: ${{ matrix.ruby_version }}
CI_RUBY_VERSION: "3.4"
- name: Run Reek
run: scripts/run-reek-all
- name: Run C++ lint
Expand All @@ -105,30 +91,59 @@ jobs:
run: scripts/run-rbs-all

test:
name: Unit Tests · Ruby ${{ matrix.ruby_version }}
name: Unit Tests · ${{ matrix.os }} · Ruby ${{ matrix.ruby_version }}
permissions:
contents: read
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
needs: [rubocop, reek]
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.2"
- "3.4"
- "4.0"
include:
- os: ubuntu-latest
ruby_version: "3.2"
- os: ubuntu-latest
ruby_version: "3.4"
- os: ubuntu-latest
ruby_version: "4.0"
- os: macos-15
ruby_version: "3.2"
- os: macos-15
ruby_version: "3.4"
- os: macos-15
ruby_version: "4.0"
- os: windows-2022
ruby_version: "3.2"
- os: windows-2022
ruby_version: "3.4"
- os: windows-2022
ruby_version: "4.0"
steps:
- uses: actions/checkout@v7
- name: Install apt packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential cmake git libyaml-dev pkg-config
- name: Install macOS packages
if: runner.os == 'macOS'
run: brew install cmake libyaml openssl@3 pkg-config
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: false
- name: Install Windows native dependencies
if: runner.os == 'Windows'
shell: cmd
run: >-
ridk exec pacman --noconfirm --needed -S
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-libyaml
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-toolchain
make
- name: Restore bundle cache
uses: actions/cache@v6
with:
Expand All @@ -137,40 +152,76 @@ jobs:
restore-keys: |
${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-
- name: Install bundles
if: runner.os == 'Linux'
run: scripts/ci-install-bundles
env:
CI_RUBY_VERSION: ${{ matrix.ruby_version }}
- name: Install macOS bundle
if: runner.os == 'macOS'
working-directory: gems/vajra
run: bundle install --jobs 4 --retry 3
- name: Install Windows bundle and compile
if: runner.os == 'Windows'
working-directory: gems/vajra
env:
VAJRA_TEST_FAULT_INJECTION: "1"
run: |
bundle install --jobs 4 --retry 3
ridk exec bundle exec rake clobber compile
- name: Run unit tests
shell: bash
env:
VAJRA_TEST_FAULT_INJECTION: "1"
run: scripts/run-rspec-unit-all
- name: Publish coverage to Qlty
if: inputs.upload_coverage && matrix.ruby_version == '3.4'
if: inputs.upload_coverage && runner.os == 'Linux' && matrix.ruby_version == '3.4'
uses: qltysh/qlty-action/coverage@v2
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: |
${{ github.workspace }}/gems/vajra/coverage/.resultset.json

test_e2e:
name: E2E Tests · Ruby ${{ matrix.ruby_version }}
name: E2E Tests · ${{ matrix.os }} · Ruby ${{ matrix.ruby_version }}
permissions:
contents: read
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
needs: [rubocop, reek]
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.2"
- "3.4"
- "4.0"
include:
- os: ubuntu-latest
ruby_version: "3.2"
- os: ubuntu-latest
ruby_version: "3.4"
- os: ubuntu-latest
ruby_version: "4.0"
- os: macos-15
ruby_version: "3.2"
- os: macos-15
ruby_version: "3.4"
- os: macos-15
ruby_version: "4.0"
- os: windows-2022
ruby_version: "3.2"
- os: windows-2022
ruby_version: "3.4"
- os: windows-2022
ruby_version: "4.0"
steps:
- uses: actions/checkout@v7
- name: Install apt packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential git libyaml-dev pkg-config
- name: Install macOS packages
if: runner.os == 'macOS'
run: brew install libyaml openssl@3 pkg-config
- name: Install h2spec
if: runner.os == 'Linux'
env:
H2SPEC_VERSION: v2.6.0
H2SPEC_SHA256: 157ee0de702e01ad40e752dbf074b366027e550c8e7504f9450da2809e279318
Expand All @@ -187,6 +238,16 @@ jobs:
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: false
- name: Install Windows native dependencies
if: runner.os == 'Windows'
shell: cmd
run: >-
ridk exec pacman --noconfirm --needed -S
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-libyaml
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-toolchain
make
- name: Restore bundle cache
uses: actions/cache@v6
with:
Expand All @@ -195,12 +256,30 @@ jobs:
restore-keys: |
${{ runner.os }}-ruby-${{ matrix.ruby_version }}-bundle-
- name: Install bundles
if: runner.os == 'Linux'
run: scripts/ci-install-bundles
env:
CI_RUBY_VERSION: ${{ matrix.ruby_version }}
- name: Install macOS bundle
if: runner.os == 'macOS'
working-directory: gems/vajra
run: bundle install --jobs 4 --retry 3
- name: Install Windows bundle and compile
if: runner.os == 'Windows'
working-directory: gems/vajra
env:
VAJRA_TEST_FAULT_INJECTION: "1"
run: |
bundle install --jobs 4 --retry 3
ridk exec bundle exec rake clobber compile
- name: Run e2e tests
shell: bash
env:
VAJRA_TEST_FAULT_INJECTION: "1"
NO_COVERAGE: "1"
run: scripts/run-rspec-e2e-all
- name: Run HTTP/2 h2spec conformance tests
if: runner.os == 'Linux'
run: scripts/run-h2spec-all

build_package:
Expand Down Expand Up @@ -268,3 +347,13 @@ jobs:
CI_RUBY_VERSION: ${{ env.RUBY_VERSION }}
- name: Build docs
run: scripts/run-docs-build-all

ci_finished:
name: ci_finished
permissions:
contents: read
runs-on: ubuntu-latest
needs: [test, test_e2e]
steps:
- name: Confirm all tests passed
run: echo "ci_finished"
Loading
Loading