MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / detectArrivedChannelFiles

Function detectArrivedChannelFiles

packages/bumpy/src/commands/ci.ts:841–864  ·  view source on GitHub ↗

* Channels whose dirs gained bump files in the triggering push — i.e. this push is * the promotion/graduation merge that delivered them. (Same range detection as the * channel publish trigger.)

(rootDir: string, config: BumpyConfig)

Source from the content-addressed store, hash-verified

839 * channel publish trigger.)
840 */
841function detectArrivedChannelFiles(rootDir: string, config: BumpyConfig): Set<string> {
842 const range = getPushEventRange();
843 let diffRange: string;
844 if (range) {
845 diffRange = `${range.before}..${range.after}`;
846 } else {
847 if (!tryRunArgs(['git', 'rev-parse', '--verify', 'HEAD^'], { cwd: rootDir })) return new Set();
848 diffRange = 'HEAD^..HEAD';
849 }
850 // --no-renames so file moves into channel dirs show up as additions
851 const out = tryRunArgs(
852 ['git', 'diff', '--name-only', '--diff-filter=A', '--no-renames', diffRange, '--', '.bumpy/'],
853 { cwd: rootDir },
854 );
855 if (!out) return new Set();
856 const knownChannels = new Set(channelNames(config));
857 const arrived = new Set<string>();
858 for (const f of out.split('\n')) {
859 if (!f.endsWith('.md') || f.endsWith('README.md')) continue;
860 const parts = f.split('/'); // .bumpy/<channel>/<id>.md
861 if (parts.length === 3 && knownChannels.has(parts[1]!)) arrived.add(parts[1]!);
862 }
863 return arrived;
864}
865
866/**
867 * Close lingering channel release PRs whose cycles were promoted: once a channel's

Callers 1

Calls 3

tryRunArgsFunction · 0.90
channelNamesFunction · 0.90
getPushEventRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…