Skip to content

Conversation

iammuho
Copy link

@iammuho iammuho commented Jan 19, 2021

Issue: #482
Note: For this option to be working, options should be running on async. Before this PR to be accepted, please look at this PR: #481 (MERGED)

This PR adds a Jira option to the below validators. If anyone wants to check JIRA TICKET to be validated through JIRA APIs;

  1. Enable JIRA Settings via env variables;
JIRA_PASSWORD //API TOKEN
JIRA_USERNAME //USERNAME
JIRA_HOST //HOST
JIRA_PROTOCOL // default 'https'
JIRA_VERSION // default '2'
JIRA_STRICT_SSL // default 'true'
  1. Enable JIRA VALIDATION option in validators;
---
version: 2
mergeable:
  - when: pull_request.*, pull_request_review.*
    name: 'checkfirst'
    validate:
      - do: title
        jira:
          regex: '[A-Z][A-Z0-9]+-\d+'
          regex_flag: none
          message: 'JIRA Ticket ID is not valid'

You can use JIRA VALIDATION option in below validators;

  • title
  • headRef
  • description
  • label
  • commit
  • milestone

@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #483 (c40584f) into master (b6e7962) will increase coverage by 0.16%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   92.22%   92.38%   +0.16%     
==========================================
  Files          75       76       +1     
  Lines        1775     1997     +222     
  Branches      346      410      +64     
==========================================
+ Hits         1637     1845     +208     
- Misses        117      133      +16     
+ Partials       21       19       -2     
Impacted Files Coverage Δ
lib/validators/commit.js 100.00% <ø> (ø)
lib/validators/description.js 100.00% <ø> (ø)
lib/validators/headRef.js 100.00% <ø> (ø)
lib/validators/label.js 100.00% <ø> (ø)
lib/validators/milestone.js 100.00% <ø> (ø)
lib/validators/title.js 100.00% <ø> (ø)
lib/validators/validator.js 92.00% <ø> (-1.03%) ⬇️
lib/validators/options_processor/options/jira.js 85.00% <85.00%> (ø)
lib/interceptors/interceptor.js 33.33% <0.00%> (-16.67%) ⬇️
lib/actions/assign.js 86.95% <0.00%> (-7.79%) ⬇️
... and 61 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6e7962...603f134. Read the comment docs.

@iammuho
Copy link
Author

iammuho commented Jan 27, 2021

hey @jusx any comments for this ?

Copy link
Member

@jusx jusx left a comment

Choose a reason for hiding this comment

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

Overall looks good. Left a comment about the enabled suboption.

@iammuho
Copy link
Author

iammuho commented Jan 28, 2021

hey @jusx , you can check again. You are right, no need for enabled.

Copy link
Member

@jusx jusx left a comment

Choose a reason for hiding this comment

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

@iammuho Added additional comments. I would recommend including some docs either in this PR or create an issue regarding docs so that it is in the backlog.

@iammuho
Copy link
Author

iammuho commented Jan 29, 2021

@jusx , removed all references and sent the docs. I think in the docs we should also enable options menu to explain options one by one like validators and actions, because i.e JIRA option does work only self-hosted (to set environment values) For now, I've added how to add JIRA option to required validators, on another PR I'll add options part to the docs.

@jusx jusx merged commit 444786e into mergeability:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants