Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add optional commit SHA in config.#93

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jefchien wants to merge1 commit intobenchmark-action:master
base:master
Choose a base branch
Loading
fromjefchien:add-optional-commit-sha

Conversation

@jefchien
Copy link

Description

Allows the user to pass in a commit SHA to use instead of relying on the payload or head commit. The main use-case of this is for workflow dispatch runs where the SHA is provided through an input.

This change should be valid based onhttps://docs.github.com/en/rest/reference/commits#get-a-commit.

matthargett reacted with thumbs up emoji

asyncfunctiongetCommit(githubToken?:string):Promise<Commit>{
asyncfunctiongetCommit(githubToken?:string,commitSha?:string):Promise<Commit>{
if(commitSha&&githubToken){

Choose a reason for hiding this comment

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

Should this line be placed after the line253-261 ? Mostly I can't see any reason to let this success faster though.

Copy link
Author

Choose a reason for hiding this comment

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

Well, if you've provided the commit SHA, then your intention is for the action to use it. I don't see why it should even attempt to use the other options.

WorldSEnder reacted with thumbs up emoji
Copy link

@khanhntdkhanhntd left a comment

Choose a reason for hiding this comment

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

LGTM.

@ktrz
Copy link
Member

Hi@jefchien

Thank you for your contribution! Could you please explain to me a bit more why would we want to provide the SHA as an input rather than just using the one provided via pull request or fall back to the current commit's sha?

@jefchien
Copy link
Author

Hi@ktrz,

So, in my use case, the workflow where the action is used can be triggered by a workflow dispatch where the SHA is provided as an input. This allows us to run the benchmarking after successful CI workflow runs or on selected commits. The issue I've found is that thegithub.context.ref used in the fall back is the workflow commit SHA rather than the one actually used in the benchmarking. If there's another way to access the workflow dispatch inputs, it might be a better solution. This PR provides an optional field that will supersede any of the other attempts.

@NathanielRN
Copy link
Contributor

@jefchien

Is running theworkflow_dispatch job event an automated process? Instead of providing thecommit_sha as input, would you be able to push a branch or tag and run the workflow from there instead?

That way you can make the branch point to the commit you want, and run the workflow from that branch, so that the commit is correct and you don't need to provide thecommit_sha as input.

It might be more tricky if your invocation of theworkflow_dispatch job is automated (because you'd need a GitHub account to publish it from I guess) so that's why I ask.

@jefchien
Copy link
Author

@NathanielRN

Running theworkflow_dispatch is a manual process, but the same workflow is also triggered by arepository_dispatch from a different workflow. That's an interesting workaround. I suppose I could use a GitHub action likehttps://github.com/marketplace/actions/create-branch to create the branch as part of the workflow and then checkout that branch in the job used to run this action. Actually, that probably won't work since the GitHub context is based on the workflow run.

@khanhntd
Copy link

Hi@ktrz , any feedback though?

@ktrz
Copy link
Member

ktrz commentedFeb 2, 2023

I'll get back to this during the weekend as I have a pretty busy week

Copy link
Member

@ktrzktrz left a comment

Choose a reason for hiding this comment

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

The PR looks good. Just need some merge conflicts resolved. And please also include a test specific for your use-case

externalDataJsonPath:undefined,
maxItemsInChart:null,
failThreshold:2.0,
commitSha:'dummy sha',
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 we should add specific tests for the use-case where we set the explicitcommitSha rather than just adding this param here.

matthargett reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ktrzktrzktrz left review comments

+1 more reviewer

@khanhntdkhanhntdkhanhntd approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@jefchien@ktrz@NathanielRN@khanhntd

[8]ページ先頭

©2009-2025 Movatter.jp