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

Support self-hosted runners (custom runs-on values) #59

Closed
MPV opened this issue Sep 29, 2023 · 5 comments · Fixed by #64
Closed

Support self-hosted runners (custom runs-on values) #59

MPV opened this issue Sep 29, 2023 · 5 comments · Fixed by #64
Labels
needsinfo This issue requires further information from the submitter to proceed

Comments

@MPV
Copy link
Contributor

MPV commented Sep 29, 2023

There's plenty of warnings received when using a self-hosted runner in workflows, since it doesn't match the enum's in this schema:
https://github.com/SchemaStore/schemastore/blob/14a055e90e675a7b1ae41fee3bcebcf8790f59de/src/schemas/json/github-workflow.json#L558-L587

For example using any of these approaches:

Then you'll get errors like:

[...]
        OneOf {
            code: "one_of",
            detail: None,
            path: "/jobs/publish-test-results",
            title: "OneOf conditions are not met",
            states: [
                ValidationState {
                    action_type: None,
                    file_path: None,
                    errors: [
                        OneOf {
                            code: "one_of",
                            detail: None,
                            path: "/jobs/publish-test-results/runs-on",
                            title: "OneOf conditions are not met",
                            states: [
                                ValidationState {
                                    action_type: None,
                                    file_path: None,
                                    errors: [
                                        Enum {
                                            code: "enum",
                                            detail: None,
                                            path: "/jobs/publish-test-results/runs-on",
                                            title: "Enum conditions are not met",
                                        },
                                    ],
                                },
                                ValidationState {
                                    action_type: None,
                                    file_path: None,
                                    errors: [
                                        WrongType {
                                            code: "wrong_type",
                                            detail: Some(
                                                "The value must be array",
                                            ),
                                            path: "/jobs/publish-test-results/runs-on",
                                            title: "Type of the value is wrong",
                                        },
                                    ],
                                },
                                ValidationState {
                                    action_type: None,
                                    file_path: None,
                                    errors: [
                                        WrongType {
                                            code: "wrong_type",
                                            detail: Some(
                                                "The value must be object",
                                            ),
                                            path: "/jobs/publish-test-results/runs-on",
                                            title: "Type of the value is wrong",
                                        },
                                    ],
                                },
                                ValidationState {
                                    action_type: None,
                                    file_path: None,
                                    errors: [
                                        Pattern {
                                            code: "pattern",
                                            detail: None,
                                            path: "/jobs/publish-test-results/runs-on",
                                            title: "Pattern condition is not met",
                                        },
                                    ],
                                },
                            ],
                        },
                    ],
                },
                ValidationState {
                    action_type: None,
                    file_path: None,
                    errors: [
                        Properties {
                            code: "properties",
                            detail: Some(
                                "Additional property 'runs-on' is not allowed",
                            ),
                            path: "/jobs/publish-test-results",
                            title: "Property conditions are not met",
                        },
                        Properties {
                            code: "properties",
                            detail: Some(
                                "Additional property 'steps' is not allowed",
                            ),
                            path: "/jobs/publish-test-results",
                            title: "Property conditions are not met",
                        },
                        Required {
                            code: "required",
                            detail: None,
                            path: "/jobs/publish-test-results/uses",
                            title: "This property is required",
                        },
                    ],
                },
            ],
        },
[...]

For comparison, see how actionlint does this:
https://github.com/rhysd/actionlint/blob/main/docs/config.md

@mpalmer
Copy link
Owner

mpalmer commented Oct 1, 2023

Yeah, self-hosted runners are rather tricky to support well (cf #5, #51). Also, since I don't use them myself, it's unlikely I'll get a sufficient shipment of round tuits to do much to make it better. Does the method described in this comment (and the rest of that issue) act as a suitable workaround? If not, can you provide a minimal example that action-validator rejects?

@MPV
Copy link
Contributor Author

MPV commented Oct 1, 2023

Yeah, self-hosted runners are rather tricky to support well (cf #5, #51).

Thanks for shining the light on those, my bad on not seeing them. 🙈

Also, since I don't use them myself, it's unlikely I'll get a sufficient shipment of round tuits to do much to make it better.

Understandable.

Does the method described in this comment (and the rest of that issue) act as a suitable workaround?

It sounds to me like that comment/issue talks about/suggests one of two approaches:

  1. Using runner groups
  2. Using runner labels

However since I'm using "ARC", it doesn't allow one to use labels anymore, as per:

I may give runner groups another think/try, maybe it's reasonable either way (to control access/usage separately too).

If not, can you provide a minimal example that action-validator rejects?

I may if I find the timing. Have moved back to actionlint for the time being. It also has actions for commenting inline suggestions using "reviewdog", thus quite nice UX and easily understandable signals:

@mpalmer mpalmer added the needsinfo This issue requires further information from the submitter to proceed label Oct 1, 2023
@MPV
Copy link
Contributor Author

MPV commented Oct 2, 2023

@MPV
Copy link
Contributor Author

MPV commented Oct 27, 2023

I say we resolve this now, as the/this upstream issue has been solved:

@MPV MPV closed this as completed Oct 27, 2023
@MPV
Copy link
Contributor Author

MPV commented Nov 24, 2023

Reopening as we'll need to bump the referenced/checked-in/submodule schemastore to get this new fix/support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needsinfo This issue requires further information from the submitter to proceed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants