Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): pass git commit sha for ReSpec based specs #167

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

dontcallmedom
Copy link
Member

@dontcallmedom dontcallmedom force-pushed the set-git-revision branch 7 times, most recently from 21f7941 to 043dade Compare October 16, 2023 06:51
@@ -26,16 +32,20 @@ export async function buildOptions(inputs: Inputs) {
const flags = [];
flags.push(...getFailOnFlags(toolchain, inputs.BUILD_FAIL_ON));

return { toolchain, source, destination, flags, configOverride };
return { toolchain, source, destination, gitRevision, flags, configOverride };
Copy link
Member

Choose a reason for hiding this comment

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

I think best would be add the gitRevision to each config override above, instead of setting it later.
Does Bikeshed set it automatically in build process, or we can pass it via config also? If not passable, can pass conditionally for ReSpec only.

Copy link
Member Author

Choose a reason for hiding this comment

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

bikeshed does it automatically already on its own

Copy link
Member Author

Choose a reason for hiding this comment

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

can you say a bit more why you think it should be in the override? this feels typically like a setting that shouldn't need to be overridden by a static configuration file

Copy link
Member

Choose a reason for hiding this comment

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

I was suggesting that only because as we can to pass it down less manually that way, as configOverride will get passed to ReSpec as respecConfig override (via URL parameters).
https://github.com/w3c/spec-prod/pull/167/files#diff-f065c431b4f45758b2e047fcd38135fdcb2327564def7a33ab41e84898210fc8L95-L101

We use same method for setting publishDate:

if (toolchain === "respec") {
conf.publishDate = publishDate = conf.publishDate || publishDate;

Copy link
Member

Choose a reason for hiding this comment

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

(I'll refactor this part someday, I find it confusing too)

Copy link
Member Author

Choose a reason for hiding this comment

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

would you be willing to make the code work like you think it should? I'm struggling a bit…

Copy link
Member

@sidvishnoi sidvishnoi Oct 16, 2023

Choose a reason for hiding this comment

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

I think if you can add following above and reset src/build.ts, that'd be enough:

const configOverride = {
	gh: getConfigOverride(inputs.GH_PAGES_BUILD_OVERRIDE),
	w3c: getConfigOverride(inputs.W3C_BUILD_OVERRIDE),
};
+ if (toolchain === 'respec) {
+ 	configOverride.gh.gitRevistion = configOverride.w3c.gitRevision = gitRevision;
+ }

Copy link
Member

Choose a reason for hiding this comment

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

If not, feel free to do it what you find simpler. We can refactor it eventually.

dontcallmedom added a commit that referenced this pull request Oct 16, 2023
dontcallmedom added a commit that referenced this pull request Oct 16, 2023
dontcallmedom added a commit that referenced this pull request Oct 16, 2023
src/prepare-build.ts Outdated Show resolved Hide resolved
@sidvishnoi sidvishnoi changed the title Pass git commit sha to build process feat(build): pass git commit sha for ReSpec based specs Oct 16, 2023
Copy link
Member

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

Thanks @dontcallmedom!
I hope to be properly back at maintaining these projects soon!

@sidvishnoi sidvishnoi merged commit 3d9a5cf into main Oct 16, 2023
1 check passed
@sidvishnoi sidvishnoi deleted the set-git-revision branch October 16, 2023 15:02
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.

2 participants