|
| 1 | +http method gitlab GET /api/v4/user 200 {"id": 555} |
| 2 | +http method gitlab GET /api/v4/projects/1234/merge_requests/1/versions 200 [{"id": 2, "head_commit_sha": "head", "base_commit_sha": "base", "start_commit_sha": "start"},{"id": 1, "head_commit_sha": "head", "base_commit_sha": "base", "start_commit_sha": "start"}] |
| 3 | +http method gitlab GET /api/v4/projects/1234/merge_requests/1/diffs 200 [{"old_path":"rules.yml","new_path":"rules.yml","diff":"@@ -1,7 +1,7 @@\n groups:\n - name: foo\n rules:\n- - record: rule1\n+ - record: rule3\n expr: sum(foo) by(job)\n - record: rule2\n expr: sum(rule1) by(job)\n"}] |
| 4 | +http method gitlab GET /api/v4/projects/1234/merge_requests/1/discussions 200 [] |
| 5 | +http method gitlab GET /api/v4/projects/1234/merge_requests 200 [{"iid": 1}] |
| 6 | +http method gitlab POST /api/v4/projects/1234/merge_requests/1/discussions 200 {} |
| 7 | +http start gitlab 127.0.0.1:6213 |
| 8 | + |
| 9 | +mkdir testrepo |
| 10 | +cd testrepo |
| 11 | +exec git init --initial-branch=main . |
| 12 | + |
| 13 | +cp ../src/v1.yml rules.yml |
| 14 | +cp ../src/.pint.hcl . |
| 15 | +env GIT_AUTHOR_NAME=pint |
| 16 | +env GIT_AUTHOR_EMAIL=pint@example.com |
| 17 | +env GIT_COMMITTER_NAME=pint |
| 18 | +env GIT_COMMITTER_EMAIL=pint@example.com |
| 19 | +exec git add . |
| 20 | +exec git commit -am 'import rules and config' |
| 21 | + |
| 22 | +exec git checkout -b v2 |
| 23 | +cp ../src/v2.yml rules.yml |
| 24 | +exec git commit -am 'v2' |
| 25 | + |
| 26 | +env GITLAB_AUTH_TOKEN=secret |
| 27 | +exec pint -l debug --offline --no-color ci |
| 28 | +! stdout . |
| 29 | +cmp gitlab.got ../gitlab.expected |
| 30 | + |
| 31 | +-- src/v1.yml -- |
| 32 | +groups: |
| 33 | +- name: foo |
| 34 | + rules: |
| 35 | + - record: rule1 |
| 36 | + expr: sum(foo) by(job) |
| 37 | + - record: rule2 |
| 38 | + expr: sum(rule1) by(job) |
| 39 | + |
| 40 | +-- src/v2.yml -- |
| 41 | +groups: |
| 42 | +- name: foo |
| 43 | + rules: |
| 44 | + - record: rule3 |
| 45 | + expr: sum(foo) by(job) |
| 46 | + - record: rule2 |
| 47 | + expr: sum(rule1) by(job) |
| 48 | + |
| 49 | +-- src/.pint.hcl -- |
| 50 | +ci { |
| 51 | + baseBranch = "main" |
| 52 | +} |
| 53 | +repository { |
| 54 | + gitlab { |
| 55 | + uri = "http://127.0.0.1:6213" |
| 56 | + timeout = "30s" |
| 57 | + project = "1234" |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +-- gitlab.expected -- |
| 62 | +GET /api/v4/user |
| 63 | + Accept: application/json |
| 64 | + Accept-Encoding: gzip |
| 65 | + Private-Token: secret |
| 66 | + |
| 67 | +GET /api/v4/projects/1234/merge_requests |
| 68 | + Accept: application/json |
| 69 | + Accept-Encoding: gzip |
| 70 | + Private-Token: secret |
| 71 | + |
| 72 | +GET /api/v4/projects/1234/merge_requests/1/versions |
| 73 | + Accept: application/json |
| 74 | + Accept-Encoding: gzip |
| 75 | + Private-Token: secret |
| 76 | + |
| 77 | +GET /api/v4/projects/1234/merge_requests/1/diffs |
| 78 | + Accept: application/json |
| 79 | + Accept-Encoding: gzip |
| 80 | + Private-Token: secret |
| 81 | + |
| 82 | +GET /api/v4/projects/1234/merge_requests/1/discussions |
| 83 | + Accept: application/json |
| 84 | + Accept-Encoding: gzip |
| 85 | + Private-Token: secret |
| 86 | + |
| 87 | +POST /api/v4/projects/1234/merge_requests/1/discussions |
| 88 | + Accept: application/json |
| 89 | + Accept-Encoding: gzip |
| 90 | + Content-Type: application/json |
| 91 | + Private-Token: secret |
| 92 | +--- BODY --- |
| 93 | +body: | |
| 94 | + :warning: **Warning** reported by [pint](https://cloudflare.github.io/pint/) **rule/dependency** check. |
| 95 | + |
| 96 | + ------ |
| 97 | + |
| 98 | + rule results used by another rule |
| 99 | + |
| 100 | + <details> |
| 101 | + <summary>More information</summary> |
| 102 | + If you remove the recording rule generating `rule1`, and there is no other source of this metric, then any other rule depending on it will break. |
| 103 | + List of found rules that are using `rule1`: |
| 104 | + |
| 105 | + - `rule2` at `rules.yml:7` |
| 106 | + |
| 107 | + </details> |
| 108 | + |
| 109 | + ------ |
| 110 | + |
| 111 | + :information_source: To see documentation covering this check and instructions on how to resolve it [click here](https://cloudflare.github.io/pint/checks/rule/dependency.html). |
| 112 | +position: |
| 113 | + base_sha: base |
| 114 | + head_sha: head |
| 115 | + start_sha: start |
| 116 | + new_path: rules.yml |
| 117 | + old_path: rules.yml |
| 118 | + position_type: text |
| 119 | + old_line: 4 |
| 120 | +--- END --- |
| 121 | + |
0 commit comments