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: ability to lint branches other then master #234

Closed
Sou1Aced opened this issue Aug 27, 2020 · 7 comments
Closed

feat: ability to lint branches other then master #234

Sou1Aced opened this issue Aug 27, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Sou1Aced
Copy link

Currently, the validator for wei/pull (https://pull.git.ci/check/${owner}/${repo})only checks the master branch of the repository, but lists "no file found" if it is added in a branch other then master. This causes a problem of not being able to test/validate the .yml before merging.

Adding this would allow the ability to validate the pull.yml file before merging with the master file, allowing for testing before hand.

@wei
Copy link
Owner

wei commented Aug 27, 2020

Thanks @Sou1Aced for the feedback. I have created a runkit endpoint that can validate any file against pull's joi schema:

https://pull-validation-uxx737qt0sl1.runkit.sh/?url=<raw file url>

e.g. https://pull-validation-uxx737qt0sl1.runkit.sh/?url=https://raw.githubusercontent.com/wei/pull/master/.github/pull.yml

Make sure you url encode the <raw file url> parameter if it contains a query string (seen in private repo raw links).

@wei wei closed this as completed Aug 27, 2020
@wei wei self-assigned this Aug 27, 2020
@wei wei added the enhancement New feature or request label Aug 27, 2020
@spam-n-eggs
Copy link

Thanks @wei! I was looking for a solution to this, too.

wei added a commit that referenced this issue Aug 27, 2020
@pythoninthegrass
Copy link

Thanks @Sou1Aced for the feedback. I have created a runkit endpoint that can validate any file against pull's joi schema:

https://pull-validation-uxx737qt0sl1.runkit.sh/?url=<raw file url>

e.g. https://pull-validation-uxx737qt0sl1.runkit.sh/?url=https://raw.githubusercontent.com/wei/pull/master/.github/pull.yml

Make sure you url encode the <raw file url> parameter if it contains a query string (seen in private repo raw links).

Is this still accurate for private repos? Response timed out when I fed it the raw URL to my pull.yml; it doesn't contain any querystrings.

FWIW this is everything it contains:

version: "1"

rules:
  - base: main
    upstream: rajnandan1:main
    mergeMethod: hardreset  # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
    mergeUnstable: false    # Optional, merge pull request even when the mergeable_state is not clean. Default: false

label: ":arrow_heading_down: pull"  # Optional
conflictLabel: "merge-conflict"     # Optional, on merge conflict assign a custom label, Default: merge-conflict

@wei
Copy link
Owner

wei commented Mar 31, 2024

@pythoninthegrass Runkit won't have permission to load the yml from private repos. You could host the file somewhere else (like a gist) to check.

@pythoninthegrass
Copy link

I'll give it a shot. Thanks!

@pythoninthegrass
Copy link

Think it's working with public gists! This URL is what I got for another pull.yml.

The json response is

{
  "version": "1",
  "rules": [
    {
      "base": "main",
      "upstream": "somet-code:main",
      "mergeMethod": "hardreset",
      "mergeUnstable": false,
      "assignees": [],
      "reviewers": [],
      "conflictReviewers": []
    }
  ],
  "label": ":arrow_heading_down: pull",
  "conflictLabel": "merge-conflict"
}

which appears to have validated as expected. Tested against another purposely malformed gist and got

ValidationError: "rules[0].base" is required

@rolzy-rio
Copy link

Hi @wei thank you for this! Can you please check if the runkit endpoint is still online? I'm trying the same URL posted by @pythoninthegrass but I am getting a timeout (The server did not return a response quickly enough).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants