mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
chore: revert repo references to Kaelio/ktx and remove rename-resilience (#252)
The GitHub repo was renamed back from Kaelio/ktx-ai-data-agents-context to Kaelio/ktx, reverting the URL changes from #250 across package metadata, CI (codecov + star-history slugs), issue/security templates, the release runbook, and docs/install commands. Also removes the rename-resilience machinery #250 added: semantic-release now reads the repository URL straight from package.json (Kaelio/ktx) again, so the repositoryUrl() derivation in scripts/semantic-release-config.cjs, its tests, and the rename note in docs/release.md are no longer needed.
This commit is contained in:
parent
13774bfcef
commit
41e20c9ce7
17 changed files with 34 additions and 94 deletions
|
|
@ -104,22 +104,6 @@ function releaseTag(kind, env = process.env) {
|
|||
return `branch-${branchPrereleaseId(branchName)}`;
|
||||
}
|
||||
|
||||
function repositoryUrl(env = process.env) {
|
||||
// @semantic-release/github compares this URL's owner/repo against the live
|
||||
// GitHub clone_url with an exact match (no redirect following), so a repo
|
||||
// rename breaks the release unless repositoryUrl tracks the *current* name.
|
||||
// In CI, derive it from the runner's repository so renames never re-break the
|
||||
// release. Outside CI, return undefined so semantic-release falls back to the
|
||||
// package.json `repository` field (its documented default).
|
||||
const repository = env.GITHUB_REPOSITORY;
|
||||
if (!repository) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const server = env.GITHUB_SERVER_URL || 'https://github.com';
|
||||
return `${server}/${repository}.git`;
|
||||
}
|
||||
|
||||
function releaseBranches(env = process.env) {
|
||||
const kind = releaseKind(env);
|
||||
|
||||
|
|
@ -143,12 +127,10 @@ function releaseBranches(env = process.env) {
|
|||
function createReleaseConfig(env = process.env) {
|
||||
const kind = releaseKind(env);
|
||||
const tag = releaseTag(kind, env);
|
||||
const url = repositoryUrl(env);
|
||||
|
||||
return {
|
||||
tagFormat: 'v${version}',
|
||||
branches: releaseBranches(env),
|
||||
...(url ? { repositoryUrl: url } : {}),
|
||||
plugins: [
|
||||
[
|
||||
'@semantic-release/commit-analyzer',
|
||||
|
|
@ -221,5 +203,4 @@ module.exports = {
|
|||
releaseBranches,
|
||||
releaseKind,
|
||||
releaseTag,
|
||||
repositoryUrl,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
|
|||
import { describe, it } from 'node:test';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const { createReleaseConfig, releaseBranches, releaseKind, releaseTag, repositoryUrl } = require('./semantic-release-config.cjs');
|
||||
const { createReleaseConfig, releaseBranches, releaseKind, releaseTag } = require('./semantic-release-config.cjs');
|
||||
|
||||
function prepareExecOptions(config) {
|
||||
return config.plugins.find((plugin) => Array.isArray(plugin) && plugin[0] === '@semantic-release/exec' && plugin[1].prepareCmd)[1];
|
||||
|
|
@ -141,38 +141,6 @@ describe('semantic-release config', () => {
|
|||
assert.match(analyzeExec[1].analyzeCommitsCmd, /FORCE_RELEASE === 'true' \? 'patch' : ''/);
|
||||
});
|
||||
|
||||
it('pins repositoryUrl to the runner repository so a GitHub rename never re-breaks the release', () => {
|
||||
// @semantic-release/github exact-matches repositoryUrl against the live
|
||||
// clone_url, so the release must track the *current* repo name, not the
|
||||
// static package.json value.
|
||||
assert.equal(
|
||||
repositoryUrl({ GITHUB_REPOSITORY: 'Kaelio/ktx-ai-data-agents-context' }),
|
||||
'https://github.com/Kaelio/ktx-ai-data-agents-context.git',
|
||||
);
|
||||
assert.equal(
|
||||
repositoryUrl({ GITHUB_REPOSITORY: 'Kaelio/ktx' }),
|
||||
'https://github.com/Kaelio/ktx.git',
|
||||
'a later rename back to Kaelio/ktx must resolve without any code change',
|
||||
);
|
||||
assert.equal(
|
||||
repositoryUrl({ GITHUB_REPOSITORY: 'Kaelio/ktx', GITHUB_SERVER_URL: 'https://ghe.example.com' }),
|
||||
'https://ghe.example.com/Kaelio/ktx.git',
|
||||
);
|
||||
|
||||
const config = createReleaseConfig({
|
||||
KTX_RELEASE_KIND: 'stable',
|
||||
GITHUB_REF_NAME: 'main',
|
||||
GITHUB_REPOSITORY: 'Kaelio/ktx-ai-data-agents-context',
|
||||
});
|
||||
assert.equal(config.repositoryUrl, 'https://github.com/Kaelio/ktx-ai-data-agents-context.git');
|
||||
});
|
||||
|
||||
it('omits repositoryUrl outside CI so semantic-release falls back to package.json', () => {
|
||||
assert.equal(repositoryUrl({}), undefined);
|
||||
const config = createReleaseConfig({ KTX_RELEASE_KIND: 'stable', GITHUB_REF_NAME: 'main' });
|
||||
assert.equal('repositoryUrl' in config, false);
|
||||
});
|
||||
|
||||
it('does not configure any commit type to create an automatic major release', () => {
|
||||
const config = createReleaseConfig({ KTX_RELEASE_KIND: 'stable', GITHUB_REF_NAME: 'main' });
|
||||
const analyzer = config.plugins.find(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue