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
36 changes: 36 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,21 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Test against the siblings' main
# The committed constraints stay on the 0.1 line the released 0.1.0 satisfies
# (SiblingConstraintsTest). CI aliases the siblings' main into that line so
# this repository is tested against what it will ship beside, and restores
# composer.json after the install so tests read the committed constraints.
run: composer require "ichava/core:dev-main as 0.1.99" --no-update --no-interaction

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Report the resolved siblings and restore composer.json
run: |
for p in ichava/core; do composer show "$p" | grep -E '^(name|versions|source) '; done
git checkout -- composer.json

- name: Run Laravel Pint
run: composer pint

Expand All @@ -48,9 +60,21 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Test against the siblings' main
# The committed constraints stay on the 0.1 line the released 0.1.0 satisfies
# (SiblingConstraintsTest). CI aliases the siblings' main into that line so
# this repository is tested against what it will ship beside, and restores
# composer.json after the install so tests read the committed constraints.
run: composer require "ichava/core:dev-main as 0.1.99" --no-update --no-interaction

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Report the resolved siblings and restore composer.json
run: |
for p in ichava/core; do composer show "$p" | grep -E '^(name|versions|source) '; done
git checkout -- composer.json

- name: Run PHPStan
run: composer analyse

Expand All @@ -70,9 +94,21 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Test against the siblings' main
# The committed constraints stay on the 0.1 line the released 0.1.0 satisfies
# (SiblingConstraintsTest). CI aliases the siblings' main into that line so
# this repository is tested against what it will ship beside, and restores
# composer.json after the install so tests read the committed constraints.
run: composer require "ichava/core:dev-main as 0.1.99" --no-update --no-interaction

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Report the resolved siblings and restore composer.json
run: |
for p in ichava/core; do composer show "$p" | grep -E '^(name|versions|source) '; done
git checkout -- composer.json

- name: Security Audit
run: composer audit

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,20 @@ jobs:
php-version: '8.4'
coverage: none

- name: Test against the siblings' main
# The committed constraints stay on the 0.1 line the released 0.1.0 satisfies
# (SiblingConstraintsTest). CI aliases the siblings' main into that line so
# this repository is tested against what it will ship beside, and restores
# composer.json after the install so tests read the committed constraints.
run: composer require "ichava/core:dev-main as 0.1.99" --no-update --no-interaction

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Report the resolved siblings and restore composer.json
run: |
for p in ichava/core; do composer show "$p" | grep -E '^(name|versions|source) '; done
git checkout -- composer.json

- name: Assert the docs shape
run: vendor/bin/pest --filter=DocsShapeTest
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,22 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Test against the siblings' main
# The committed constraints stay on the 0.1 line the released 0.1.0 satisfies
# (SiblingConstraintsTest). CI aliases the siblings' main into that line so
# this repository is tested against what it will ship beside, and restores
# composer.json after the install so tests read the committed constraints.
run: composer require "ichava/core:dev-main as 0.1.99" --no-update --no-interaction

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Report the resolved siblings and restore composer.json
run: |
for p in ichava/core; do composer show "$p" | grep -E '^(name|versions|source) '; done
git checkout -- composer.json

- name: Execute tests
run: vendor/bin/pest
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to `ichava/icon-sets-flag` follow [Keep a Changelog](https:/
### Added

- **The pack declares its SVG kind.** `config.json` sets `package.kind` to `icon`, the kind ichava/core resolves for every category that names none of its own (core reads it from ichava/core#148; an older core ignores the key). `tests/Feature/SvgKindTest.php` fails on a kind core would not recognise, on a category that resolves none, and, against a core that has `IconRegistry::kindFor()`, on any category core resolves differently. `RetiredCopiesTest` also pins a non-empty description for every label core loads.
- **`SiblingConstraintsTest` keeps every `ichava/*` constraint on the released line.** At release every ichava repository becomes one commit tagged `v0.1.0`, so 0.1.0 is the only version of any sibling. The test reads `require` and `require-dev` in `composer.json`, fails on any `ichava/*` constraint that 0.1.0 does not satisfy (checked with `composer/semver`, now a direct dev requirement), and fails when it finds no constraint to check.

### Changed

Expand All @@ -15,6 +16,7 @@ All notable changes to `ichava/icon-sets-flag` follow [Keep a Changelog](https:/
- **`sync-upstream.yml` commits as the github-actions bot's noreply address** instead of a personal GitHub login, matching packs scaffolded since icon-sets-package-scaffolder#60 and icon-sets-sync's default. The personal-contact guard now also reads `.github/` and `.dev/`.
- **The package author is Simtabi LLC, not a person.** `composer.json` named a personal maintainer and mailbox as author; it now names `Simtabi LLC` with the role address `ichava@simtabi.com` (no personal contact is published, decided 2026-10-28). `NoPersonalContactTest` reads `composer.json`, `README.md`, `LICENSE`, `docs/` and `src/`, fails on a personal name or address, and fails when it reads fewer files than it did when written.
- **`sync-upstream.yml`'s header describes what the workflow runs.** It said the image bundles Python and that a release ships to Packagist. The image is icon-sets-sync's Go binary with git, gh and Node, built from the toolkit's `main`, and a release is the GitHub release that release-please and `release.yml` make; nothing is published to Packagist. Comments only: the workflow runs the same steps.
- **CI tests against `ichava/core`'s `main`.** Every job that installs dependencies first aliases core's `main` into the 0.1 line (`composer require "ichava/core:dev-main as 0.1.99" --no-update`), prints the commit it resolved, and restores `composer.json` after the install, so the committed constraint is unchanged and the tests read it. Against that core, `SvgKindTest`'s comparison with `IconRegistry::kindFor()` runs instead of skipping.

### Removed

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
}
],
"require-dev": {
"composer/semver": "^3.4",
"orchestra/testbench": "^11.0",
"pestphp/pest": "^4.6 || ^5.0",
"phpstan/phpstan": "^2.1",
Expand Down
6 changes: 6 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ raising it alone, which would trap consumers who stay on the older series.
- **Raise the floor** when core ships a security fix in code this pack runs -- the old constraint
still resolves the vulnerable release otherwise.

Until the first release, 0.1.0 is the only core version that exists, so a raised floor such as
`^0.1.2` cannot resolve. `tests/Unit/SiblingConstraintsTest.php` fails on any `ichava/*` constraint
that 0.1.0 does not satisfy. CI still tests against core's `main`: each job aliases it into the 0.1
line before the install and restores `composer.json` afterwards, so the committed constraint never
changes.

Check before doing either:

```bash
Expand Down
56 changes: 56 additions & 0 deletions tests/Unit/SiblingConstraintsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

use Composer\Semver\Semver;

/*
|--------------------------------------------------------------------------
| Every ichava/* constraint admits 0.1.0
|--------------------------------------------------------------------------
|
| At release every ichava repository becomes one root commit tagged v0.1.0, so
| 0.1.0 is the only version of any sibling that exists. A constraint that
| excludes it, such as a floor raised to ^0.1.2, cannot resolve once released.
|
| CI tests against the siblings' main branches by aliasing them in the
| workflow and restoring composer.json after the install, so this reads the
| committed constraints, never the CI alias.
|
| Pest functions only: a PHPUnit class in the same file would stop being
| collected.
|
*/

/**
* @return array<string, string> "section.package" => constraint
*/
function siblingConstraintsInComposerJson(): array
{
$path = dirname(__DIR__, 2) . '/composer.json';
$composer = json_decode((string) file_get_contents($path), true, flags: JSON_THROW_ON_ERROR);

$found = [];
foreach (['require', 'require-dev'] as $section) {
foreach ($composer[$section] ?? [] as $package => $constraint) {
if (str_starts_with((string) $package, 'ichava/')) {
$found["{$section}.{$package}"] = (string) $constraint;
}
}
}

return $found;
}

it('admits 0.1.0 in every ichava/* constraint', function (): void {
$constraints = siblingConstraintsInComposerJson();

$this->assertNotEmpty($constraints, 'composer.json names no ichava/* constraint, so nothing was checked.');

foreach ($constraints as $where => $constraint) {
$this->assertTrue(
Semver::satisfies('0.1.0', $constraint),
"{$where} is '{$constraint}', which the released 0.1.0 does not satisfy.",
);
}
});
Loading