Skip to content

Use a temporary folder under os.tmpdir() instead of under the repo root - #822

Merged
kfranqueiro merged 5 commits into
mainfrom
kgf-tmpdir
Oct 13, 2026
Merged

kfranqueiro merged 5 commits into
mainfrom
kgf-tmpdir

Conversation

@kfranqueiro

@kfranqueiro kfranqueiro commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #821.

This revises spec-generator's temporary directory creation to use a directory under os.tmpdir() rather than a subfolder of the repository. This requires some adjustment in the ReSpec generator, since it previously took advantage of being able to effectively use the same paths both to refer to the filesystem and server URLs. (While I was at it, I have also added missing path.join usage to hopefully make this more cross-OS-compatible.)

This has the effect of resolving an interop issue with Bikeshed, where a spec with no Repository defaults to the origin remote URL of any github repository that the file being processed exists within. In the case of spec-generator being deployed from a git checkout, this resulted in falling back to spec-generator's own repo URL.

I have tested all upload code paths (both ReSpec and Bikeshed, both single file and tarball) manually. (This makes me really want to add proper unit tests for those paths though Update: I have now also finally added unit tests for the file upload code paths.)

@deniak deniak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is indeed a better way to deal with these temp files.
I left 2 comments and the 'upload' folder should now be removed from .gitignore

Comment thread server.ts Outdated
Comment thread generators/bikeshed.ts Outdated
@kfranqueiro
kfranqueiro requested a review from deniak October 9, 2026 19:10

@deniak deniak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@kfranqueiro
kfranqueiro merged commit dd95e04 into main Oct 13, 2026
4 checks passed
@kfranqueiro
kfranqueiro deleted the kgf-tmpdir branch October 13, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec-generator sometimes generates issue tracking links pointing here instead of at the spec's repo

2 participants