Skip to content

Commit 5a068dc

Browse files
authored
fix(php): remove composer updates (#213)
In PHP we just want to use tags to manage release versions, no composer.json "version" field
1 parent e163d6f commit 5a068dc

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/strategies/php.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Generic
1616
import {Changelog} from '../updaters/changelog';
1717
// PHP Specific.
18-
import {RootComposerUpdatePackages} from '../updaters/php/root-composer-update-packages';
18+
// import {RootComposerUpdatePackages} from '../updaters/php/root-composer-update-packages';
1919
import {BaseStrategy, BuildUpdatesOptions, BaseStrategyOptions} from './base';
2020
import {Update} from '../update';
2121
import {VersionsMap} from '../version';
@@ -57,6 +57,11 @@ export class PHP extends BaseStrategy {
5757
}),
5858
});
5959

60+
/**
61+
62+
STAINLESS-EDIT: Note from Hao & Jacob: In Packagist we want to prefer using the github tag rather than
63+
composer version. Releases can be skipped if the tag version misaligns with the composer version.
64+
6065
// update composer.json
6166
updates.push({
6267
path: this.addPath('composer.json'),
@@ -65,7 +70,8 @@ export class PHP extends BaseStrategy {
6570
version,
6671
versionsMap,
6772
}),
68-
});
73+
});
74+
*/
6975

7076
return updates;
7177
}

test/strategies/php.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {buildMockConventionalCommit} from '../helpers';
2222
import {TagName} from '../../src/util/tag-name';
2323
import {Version} from '../../src/version';
2424
import {Changelog} from '../../src/updaters/changelog';
25-
import {RootComposerUpdatePackages} from '../../src/updaters/php/root-composer-update-packages';
25+
// import {RootComposerUpdatePackages} from '../../src/updaters/php/root-composer-update-packages';
2626

2727
const sandbox = sinon.createSandbox();
2828

@@ -95,9 +95,14 @@ describe('PHP', () => {
9595
latestRelease,
9696
});
9797
const updates = release!.updates;
98-
expect(updates).lengthOf(2);
98+
// Stainless EDIT: we removed updates to the composer.json file
99+
expect(updates).lengthOf(1);
99100
assertHasUpdate(updates, 'CHANGELOG.md', Changelog);
100-
assertHasUpdate(updates, 'composer.json', RootComposerUpdatePackages);
101+
102+
// Original:
103+
// expect(updates).lengthOf(2);
104+
// assertHasUpdate(updates, 'CHANGELOG.md', Changelog);
105+
// assertHasUpdate(updates, 'composer.json', RootComposerUpdatePackages);
101106
});
102107
});
103108
});

0 commit comments

Comments
 (0)