Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,763
    • Issues 44,763
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #229794
Closed
Open
Issue created Jul 17, 2020 by Jason Yavorska@jyavorskaContributor0 of 6 checklist items completed0/6 checklist items

Improve linter by going deeper into pipeline generation

Problem to solve

The CI Lint currently uses YamlProcessor to validate the content passed in. The YamlProcessor represents a small part of the whole pipeline creation process and it only covers syntax errors. Using YamlProcessor today it gives a false sense of validation to users because it can return that a configuration is valid but when trying to create a pipeline it fails for some other reasons not considered before. Typical examples are logical validations that occur beyond the YamlProcessor.

Example: The following syntax is considered valid by CI Lint but it would return an error test: needs 'build' when trying to actually create the pipeline.

build:
  script: echo
  stage: build
  rules:
    - if: '$CI_MERGE_REQUEST_ID'
test:
  script: echo
  stage: test
  needs: [build]

Intended users

  • Devon (DevOps Engineer)

User experience goal

Improved understanding of errors at lint-time.

Proposal

We will introduce a new mode in Ci::CreatePipelineService called dry_run: true (which is false by default). This mode would skip persisting the pipeline while letting everything else happening. In the end, a non-persisted pipeline is returned including any errors and (recently added) warnings.

Then we change the Lint controller to use Ci::CreatePipelineService with dry_run: true and pass in the content to validate.

Further details

Permissions and Security

Documentation

Availability & Testing

  • Unit test changes - Yes, please add unit tests along with new/updated logics
  • Integration test changes - not required
  • End-to-end test change - not required

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Edited Jul 30, 2020 by Tiffany Rea
Assignee
Assign to
Time tracking