craft icon indicating copy to clipboard operation
craft copied to clipboard

Registry target, create files if not exist yet

Open HazAT opened this issue 5 years ago • 5 comments

When introducing a new package, craft should try to create the required folder/file structure so this doesn't have to be done manually.

[12:23:18 PM] ======================================
[12:23:18 PM] === Publishing to target: registry ===
[12:23:18 PM] ======================================
[12:23:18 PM] [[REGISTRY]] Cloning "https://github.com/getsentry/sentry-release-registry/" to "/tmp/craft-release-registry-DFIZaD"...
[12:23:19 PM] [[REGISTRY]] Adding the version file to the registry for canonical name "npm:@sentry/wasm"...
[12:23:19 PM] Error: ENOENT: no such file or directory, open '/tmp/craft-release-registry-DFIZaD/packages/npm/@sentry/wasm/latest.json'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at RegistryTarget.addVersionToRegistry (/craft/dist/targets/registry.js:335:47)
at RegistryTarget.pushVersionToRegistry (/craft/dist/targets/registry.js:361:20)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.withTempDir (/craft/dist/utils/files.js:76:16)
at async RegistryTarget.publish (/craft/dist/targets/registry.js:398:9)
at async /craft/dist/commands/publish.js:135:13
at async Object.withTempDir (/craft/dist/utils/files.js:76:16)
at async publishToTargets (/craft/dist/commands/publish.js:101:5)
at async publishMain (/craft/dist/commands/publish.js:422:9)
at async Object.handler (/craft/dist/commands/publish.js:449:16)

HazAT avatar Jan 19 '21 12:01 HazAT

Please note, that the current behavior is there intentionally. It helps to protect against invalid canonical names; also, according to the current logic, we take latest.json (that already has links, SDK name, etc.) and just put there the new version and file infos.

If everyone is fine with letting the registry target to create new folders/packages, that behavior ^ has to change as well, and we'll have to probably keep all that meta information in the registry in .craft.yaml now.

tonyo avatar Jan 20 '21 11:01 tonyo

If we had an early warning system, I think having the current behavior in place might have been useful. Currently, it just made things worse as far as I can tell. Don't know about the meta information tho.

BYK avatar Jan 20 '21 12:01 BYK

We agreed internally that it should stay as is for now.

kamilogorek avatar Feb 21 '22 10:02 kamilogorek

I'm reopening this. This should not require me or someone else with permissions from the registry repo to release a new package.

mitsuhiko avatar Feb 27 '23 16:02 mitsuhiko

From an SDK maintainer's perspective, I agree that this should be automated. Releasing new packages for the first time is not something that happens daily but there are quite a few items on our (JS SDK) new SDK release checklist we need to consider whenever we add new SDKs. We had multiple failed releases in the past because of the release registry entries not being made in the correct order (this checklist emerged as a result). I'd say anything that reduces the friction on all involved parties would be greatly appreciated :)

Lms24 avatar Feb 27 '23 16:02 Lms24