Skip to content

feat: ability to lint branches other then master #234

Closed

Description

@Sou1Aced

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.

Activity

  1. wei commented on Aug 27, 2020

    @wei
    Owner

    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).

  2. self-assigned this
    on Aug 27, 2020
  3. spam-n-eggs commented on Aug 27, 2020

    @spam-n-eggs

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

  4. added a commit that references this issue on Aug 27, 2020
  5. pythoninthegrass commented on Mar 26, 2024

    @pythoninthegrass

    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
  6. wei commented on Mar 31, 2024

    @wei
    Owner

    @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.

  7. pythoninthegrass commented on Mar 31, 2024

    @pythoninthegrass

    I'll give it a shot. Thanks!

  8. pythoninthegrass commented on Apr 7, 2024

    @pythoninthegrass

    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
  9. rolzy-rio commented on Aug 27, 2024

    @rolzy-rio

    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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions