17 Commits

Author SHA1 Message Date
1ef6c41818 build(version): bump version 0.4.0 → 0.5.0 2022-01-16 00:09:42 +00:00
Jon
1093b380cb Merge branch '6-fix-merging-jobs-failing' into 'development'
fix: merge jobs failing

See merge request nofusscomputing/projects/gitlab-ci!13
2022-01-16 00:05:29 +00:00
f4670844cc docs(README.md): Added project header template
MR !13
2022-01-16 09:23:54 +09:30
140985c3a4 feat(.yaml_lint_defaults): Always run on all branches as this denotes quality.
must run on all branches as quality is an expectation that should be displayed
for all branches.

MR !13
2022-01-16 09:04:52 +09:30
82c6c9f5d5 feat(commit_footer_refs): never run on development or master.
this job checks for gitlab references in the commit footer. It
has been stopped from running on dev and master as checks are already
done on the developers branch that is being worked on prior to the
merging to dev or master branches.

MR !13
2022-01-16 09:02:44 +09:30
31517b4bf0 ci(MR_Title): save the merge request title as a variable and debug output in job log.
job now stores the fetched MR title in a variable that is output to the
job log for end user to view in job log.

MR !13
2022-01-16 09:02:02 +09:30
73918f2f5e fix(commit.py): filter merge request search to 'opened' and on current branch.
Merge request search now filters to 'opened' and to ones on the current branch.
if none were found, outputs 'ci: No Merge Request found, MR count "0"'

any other error with finding the merge request will output
'failed to fetch Merge Request title' this enables further debugging for
potential errors.

fixes #6 !13
2022-01-16 08:48:24 +09:30
5c9000a748 build(version): bump version 0.3.1 → 0.4.0 2022-01-15 03:53:53 +00:00
Jon
745622c214 Merge branch '6-10-11-fix-bugs' into 'development'
fix: numerous bugs

See merge request nofusscomputing/projects/gitlab-ci!12
2022-01-15 03:50:56 +00:00
e5531fc77b feat(commit.py): throw an error if no token was supplied. i.e. empty variable.
A check is done on the supplied token,
if 'None', throws an error that can be viewed in the output log and
in the job output.

fixes #11 !12
2022-01-15 13:14:58 +09:30
6b7ad95fc0 feat(commit.py): confirm a merge request was found, if not output 'ci: No Merge Request found'
issue #11 !12
2022-01-15 13:07:56 +09:30
c543c47af8 feat(commit.py): try to us CI_JOB_TOKEN before the specified token, if any.
issue #11 !12
2022-01-15 13:05:30 +09:30
99bdc2a092 fix(commit.py): fix typo that caused exception
issue #6 !12
2022-01-15 12:29:23 +09:30
d03d9fefc9 fix(conventional_commits): fetch all branches prior to check for parent branch
issue #6 !12
2022-01-15 12:23:54 +09:30
b01550e09f feat(commit.py): removed ability to fetch first commit or target branch
no longer required due to fix on #6.

issue #6 !12
2022-01-15 12:18:15 +09:30
d5782d95e8 fix(ci): added variable 'GIT_SUBMODULE_STRATEGY' to be 'recursive'
fixes #10 !12
2022-01-15 12:04:16 +09:30
42ad02ee5d fix(conventional_commits): use git show-branch to find origin branch
using git branch then filtering after '* [current-branch]' with branches
that contain 'origin/' and removing 'HEAD' and 'current-branch' leaves the
parent branch

fixes #6 !11
2022-01-15 12:04:07 +09:30
14 changed files with 128 additions and 56 deletions

View File

@ -4,4 +4,4 @@ commitizen:
name: cz_conventional_commits
tag_format: v$major.$minor.$patch$prerelease
update_changelog_on_bump: true
version: 0.3.1
version: 0.5.0

View File

@ -1,5 +1,6 @@
variables:
JOB_ROOT_DIR: '.'
GIT_SUBMODULE_STRATEGY: recursive
MY_PROJECT_ID: "28543717"
stages:

View File

@ -1,3 +1,38 @@
## v0.5.0 (2022-01-16)
### Bug Fixes
- **commit.py**: [73918f2f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/73918f2f5e19440d0e300da3a20712739c316d88) - filter merge request search to 'opened' and on current branch. [ [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [!13](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/13) ]
### Continious Integration
- **MR_Title**: [31517b4b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/31517b4bf00c1f177ef925d09b1a6714577f62c5) - save the merge request title as a variable and debug output in job log. [ [!13](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/13) ]
### Documentaton / Guides
- **README.md**: [f4670844](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f4670844cc0961bf38fbf760f8eee505a54ab495) - Added project header template [ [!13](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/13) ]
### Features
- **.yaml_lint_defaults**: [140985c3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/140985c3a4ea07cf30f7fe8c970fb07cc61b776d) - Always run on all branches as this denotes quality. [ [!13](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/13) ]
- **commit_footer_refs**: [82c6c9f5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/82c6c9f5d53594544cea9a7bc59a10ab1e9ebedd) - never run on development or master. [ [!13](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/13) ]
## v0.4.0 (2022-01-15)
### Bug Fixes
- **commit.py**: [99bdc2a0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/99bdc2a0929d4e7036e50e8ce22ce9b0f90f0736) - fix typo that caused exception [ [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **conventional_commits**: [d03d9fef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d03d9fefc916dd6730d9ffa778c11d48d621318e) - fetch all branches prior to check for parent branch [ [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **ci**: [d5782d95](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d5782d95e825d406ea805c425cfefd6752fb6e35) - added variable 'GIT_SUBMODULE_STRATEGY' to be 'recursive' [ [#10](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/10) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **conventional_commits**: [42ad02ee](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/42ad02ee5db65c3c6c33ad14fe0371c9916897bf) - use git show-branch to find origin branch [ [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [!11](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/11) ]
### Features
- **commit.py**: [e5531fc7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e5531fc77b5bdb1ccc0741e388df2d8d25ba6ade) - throw an error if no token was supplied. i.e. empty variable. [ [#11](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/11) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **commit.py**: [6b7ad95f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6b7ad95fc0ccccf79ff645bad3f86660f5096a4e) - confirm a merge request was found, if not output 'ci: No Merge Request found' [ [#11](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/11) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **commit.py**: [c543c47a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c543c47af8c7c386ae57f5a7a50904d396758c3a) - try to us `CI_JOB_TOKEN` before the specified token, if any. [ [#11](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/11) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
- **commit.py**: [b01550e0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b01550e09f273edc8a57f4ad4b41ee2d67705d41) - removed ability to fetch first commit or target branch [ [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [#6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/6) [!12](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/12) ]
## v0.3.1 (2022-01-11)
### Bug Fixes

View File

@ -1,20 +1,40 @@
<div align="center">
<div align="center" width="100%">
# No Fuss Computing - Gitlab-CI
[![Open Issues](https://img.shields.io/badge/dynamic/json?color=ff782e&logo=gitlab&style=plastic&label=Open%20Issues&query=%24.statistics.counts.opened&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fissues_statistics)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues)
<br>
![Project Status - Active](https://img.shields.io/badge/Project%20Status-Active-green?logo=gitlab&style=plastic)
<br>
![Gitlab forks count](https://img.shields.io/badge/dynamic/json?label=Forks&query=%24.forks_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2F&color=ff782e&logo=gitlab&style=plastic) ![Gitlab stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.star_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2F&color=ff782e&logo=gitlab&style=plastic) [![Open Issues](https://img.shields.io/badge/dynamic/json?color=ff782e&logo=gitlab&style=plastic&label=Open%20Issues&query=%24.statistics.counts.opened&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fissues_statistics)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues)
![GitHub forks](https://img.shields.io/github/forks/NoFussComputing/gitlab-ci?logo=github&style=plastic&color=000000&labell=Forks) ![GitHub stars](https://img.shields.io/github/stars/NoFussComputing/gitlab-ci?color=000000&logo=github&style=plastic) ![Github Watchers](https://img.shields.io/github/watchers/NoFussComputing/gitlab-ci?color=000000&label=Watchers&logo=github&style=plastic)
<br>
This project is hosted on [Gitlab](https://gitlab.com/nofusscomputing/projects/gitlab-ci) and has a read-only copy hosted on [Github](https://github.com/NoFussComputing/gitlab-ci).
| Stable Branch | [![Gitlab build status - stable](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fpipelines%3Fref%3Dmaster&logo=gitlab&style=plastic)](https://gitlab.com/nofusscomputing/projects/gitlab-ci) | [![PyLint Score](https://img.shields.io/badge/dynamic/json?&style=plastic&logo=python&label=PyLint%20Score&query=%24.PyLintScore&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fjobs%2Fartifacts%2Fmaster%2Fraw%2Fartifacts%2Fvalidation%2FPyLint%2Fbadge_pylint.json%3Fjob%3DPyLint)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/jobs/artifacts/master/file/artifacts/validation/tests/gl-code-quality-report.html?job=PyLint) |
|:----|:----|:----|
----
| development Branch | [![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic)](https://gitlab.com/nofusscomputing/projects/gitlab-ci) | [![PyLint Score](https://img.shields.io/badge/dynamic/json?&style=plastic&logo=python&label=PyLint%20Score&query=%24.PyLintScore&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fjobs%2Fartifacts%2Fdevelopment%2Fraw%2Fartifacts%2Fvalidation%2FPyLint%2Fbadge_pylint.json%3Fjob%3DPyLint)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/jobs/artifacts/development/file/artifacts/validation/tests/gl-code-quality-report.html?job=PyLint) |
|:----|:----|:----|
**Stable Branch**
![Gitlab build status - stable](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fpipelines%3Fref%3Dmaster&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fraw%2Fmaster%2F.cz.yaml) [![PyLint Score](https://img.shields.io/badge/dynamic/json?&style=plastic&logo=python&label=PyLint%20Score&query=%24.PyLintScore&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fjobs%2Fartifacts%2Fmaster%2Fraw%2Fartifacts%2Fvalidation%2FPyLint%2Fbadge_pylint.json%3Fjob%3DPyLint)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/jobs/artifacts/master/file/artifacts/validation/tests/gl-code-quality-report.html?job=PyLint)
----
**Development Branch**
![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F28543717%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fraw%2Fdevelopment%2F.cz.yaml) [![PyLint Score](https://img.shields.io/badge/dynamic/json?&style=plastic&logo=python&label=PyLint%20Score&query=%24.PyLintScore&url=https%3A%2F%2Fgitlab.com%2Fnofusscomputing%2Fprojects%2Fgitlab-ci%2F-%2Fjobs%2Fartifacts%2Fdevelopment%2Fraw%2Fartifacts%2Fvalidation%2FPyLint%2Fbadge_pylint.json%3Fjob%3DPyLint)](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/jobs/artifacts/development/file/artifacts/validation/tests/gl-code-quality-report.html?job=PyLint)
----
<br>
</div>
This repository is hosted on [gitlab.com](https://gitlab.com/nofusscomputing/projects/gitlab-ci) and has a read-only copy hosted on [github.com](https://github.com/NoFussComputing/gitlab-ci).
links:
- [Issues](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues)

View File

@ -1,5 +1,7 @@
# Changelog
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
2021-08-11 13:47:34 +0930 [def31ef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/def31ef562c0002713401652657d59320548ee85) - style(yaml_lint): fixed yaml lint errors
2021-08-04 03:23:08 +0000 [eb5cc8a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/eb5cc8a0e2885a9ed16a8d1a81611aec4d5a4d31) - build(version): bump version 0.3.0rc0 → 0.3.0rc1

View File

@ -22,19 +22,13 @@
- pip install -r $ROOT_DIR/conventional_commits/requirements.txt
- echo "[DEBUG] CI_PROJECT_ID[$CI_PROJECT_ID]"
- echo "[DEBUG] CI_COMMIT_BRANCH[$CI_COMMIT_BRANCH]"
- $ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --branch $CI_COMMIT_BRANCH --target-branch
- target_branch=$($ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --branch $CI_COMMIT_BRANCH --target-branch)
- echo "[DEBUG] Target Branch[$target_branch]"
- git clone --depth 150 -b $target_branch $CI_REPOSITORY_URL check
- cd check
- git remote rm origin
- git remote add origin $CI_REPOSITORY_URL
- git fetch --all
- git checkout --track origin/$CI_COMMIT_BRANCH
- git submodule update --init
- git show-branch -a
- target_branch=$(git show-branch -a | awk 'BEGIN { FS="\n\s+*" } { print $1 }' | awk '{print $2}' | grep '\[' | sed 's/.*\[origin\/\(.*\)\].*/\1/' | grep -v '\[' | grep -v $(git rev-parse --abbrev-ref HEAD) | grep -vi 'HEAD' | awk 'BEGIN{ RS = "" ; FS = "\n" }{print $1}')
- echo "[DEBUG] Target Branch[$target_branch]"
- if [ -d "gitlab-ci" ]; then ls -la gitlab-ci; fi
- first_sha1=$(git log $target_branch..$CI_COMMIT_BRANCH --format=format:%H | tail -1)
- first_sha1=$(git log origin/$target_branch..$CI_COMMIT_BRANCH --format=format:%H | tail -1)
- echo "[DEBUG] First Commit SHA[$first_sha1]"
- echo "[DEBUG] artifacts directory [$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME]"
after_script:
@ -61,7 +55,9 @@ MR Title:
extends:
- .conventional_commit
script:
- cz_exit=0 && cz check --message "$($ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --title --branch $CI_COMMIT_BRANCH)" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?
- MR_TITLE=$($ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --title --branch $CI_COMMIT_BRANCH)
- echo "[DEBUG] MR_TITLE[$MR_TITLE]"
- cz_exit=0 && cz check --message "$MR_TITLE" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?
- . $ROOT_DIR/conventional_commits/scripts/cz_junit.sh > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME-cz.junit.xml"

View File

@ -1,5 +1,16 @@
# Changelog
2022-01-16 09:02:02 +0930 [31517b4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/31517b4bf00c1f177ef925d09b1a6714577f62c5) - ci(MR_Title): save the merge request title as a variable and debug output in job log.
2022-01-16 08:48:24 +0930 [73918f2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/73918f2f5e19440d0e300da3a20712739c316d88) - fix(commit.py): filter merge request search to 'opened' and on current branch.
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-15 13:14:58 +0930 [e5531fc](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e5531fc77b5bdb1ccc0741e388df2d8d25ba6ade) - feat(commit.py): throw an error if no token was supplied. i.e. empty variable.
2022-01-15 13:07:56 +0930 [6b7ad95](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6b7ad95fc0ccccf79ff645bad3f86660f5096a4e) - feat(commit.py): confirm a merge request was found, if not output 'ci: No Merge Request found'
2022-01-15 13:05:30 +0930 [c543c47](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c543c47af8c7c386ae57f5a7a50904d396758c3a) - feat(commit.py): try to us `CI_JOB_TOKEN` before the specified token, if any.
2022-01-15 12:29:23 +0930 [99bdc2a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/99bdc2a0929d4e7036e50e8ce22ce9b0f90f0736) - fix(commit.py): fix typo that caused exception
2022-01-15 12:23:54 +0930 [d03d9fe](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d03d9fefc916dd6730d9ffa778c11d48d621318e) - fix(conventional_commits): fetch all branches prior to check for parent branch
2022-01-15 12:18:15 +0930 [b01550e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b01550e09f273edc8a57f4ad4b41ee2d67705d41) - feat(commit.py): removed ability to fetch first commit or target branch
2022-01-15 12:04:07 +0930 [42ad02e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/42ad02ee5db65c3c6c33ad14fe0371c9916897bf) - fix(conventional_commits): use git show-branch to find origin branch
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
2021-08-12 12:47:23 +0930 [3360a15](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3360a15fde12682edfd9044d2541dc819615b838) - fix(commit_message): fixed commit message check if there is only one commit to the branch
2021-08-11 13:47:34 +0930 [def31ef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/def31ef562c0002713401652657d59320548ee85) - style(yaml_lint): fixed yaml lint errors

View File

@ -9,13 +9,11 @@ import getopt
import json
import requests
get_first_commit = False
get_mr_title = False
get_target_branch = False
project_id = ''
try:
opts, args = getopt.getopt(sys.argv[1:],"hic:t:ti:p:b:o",["commit","token=", "title", "project=", "branch=", "target-branch"])
opts, args = getopt.getopt(sys.argv[1:],"hi:t:ti:p:b",["token=", "title", "project=", "branch="])
except getopt.GetoptError:
print('test.py [-c | --commit] [-t | --token {token}]')
@ -27,9 +25,9 @@ for opt, arg in opts:
if opt == '-h':
print('[commit.py] -i <inputfile> -o <outputfile>')
sys.exit()
elif opt in ("-c", "--commit"):
get_first_commit = True
elif opt in ("-t", "--token"):
if arg is None:
raise ValueError('Token switch was specified, however no token was supplied.')
ci_job_token = arg
elif opt in ("-ti", "--title"):
get_mr_title = True
@ -37,29 +35,39 @@ for opt, arg in opts:
project_id = str(arg)
elif opt in ("-b", "--branch"):
git_branch = arg
elif opt in ("-o", "--target-branch"):
get_target_branch = True
# private token or personal token authentication
#gl = gitlab.Gitlab('https://gitlab.com', private_token=ci_job_token)
url = 'https://gitlab.com/api/v4/projects/' + project_id + '/merge_requests'
headers = {'PRIVATE-TOKEN': ci_job_token}
url = 'https://gitlab.com/api/v4/projects/' + project_id + '/merge_requests?state=opened&source_branch=' + git_branch
merge_requests = ""
try:
if os.environ['CI_JOB_TOKEN'] == ci_job_token:
headers = {'JOB_TOKEN': os.environ['CI_JOB_TOKEN']}
if os.environ['CI_JOB_TOKEN'] is not None:
headers = {'JOB_TOKEN': os.environ['CI_JOB_TOKEN']}
if os.environ['CI_JOB_TOKEN'] == ci_job_token:
headers = {'JOB_TOKEN': os.environ['CI_JOB_TOKEN']}
merge_requests = requests.get(url, headers=headers, data='')
merge_requests = merge_requests.json()
except:
pass
#print('[DEBUG] headers[{0}]'.format(headers))
merge_requests = requests.get(url, headers=headers, data='')
if not isinstance(merge_requests, list):
headers = {'PRIVATE-TOKEN': ci_job_token}
merge_requests = merge_requests.json()
merge_requests = requests.get(url, headers=headers, data='')
merge_requests = merge_requests.json()
#print('\n\nmerge_requests=[-{0}-][]\n\n\n\n\n'.format(merge_requests))
@ -69,32 +77,24 @@ merge_requests = merge_requests.json()
#mrs = gl.mergerequests.list()
mr_title = ''
mr_title = 'failed to fetch Merge Request title'
mr_first_commit = ''
target_branch = ''
for mr in merge_requests:
if isinstance(merge_requests, list):
# print('\n\nMR=[-{0}-]'.format(mr))
if len(merge_requests) > 0:
if mr['source_branch'] == git_branch and str(mr['target_project_id']) == str(project_id) and str(mr['state']) == 'opened':
for mr in merge_requests:
if mr['source_branch'] == git_branch and str(mr['target_project_id']) == str(project_id) and str(mr['state']) == 'opened':
mr_title = mr['title']
mr_first_commit = mr['sha']
target_branch = mr['target_branch']
if get_mr_title:
print('{0}'.format(mr_title))
if get_target_branch:
print('{0}'.format(target_branch))
else:
if get_first_commit:
print('{0}'.format(mr_first_commit))
if get_mr_title:
print('{0}'.format(mr_title))
print('ci: No Merge Request found, MR count "0"')

View File

@ -1,5 +1,7 @@
# Changelog
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
2021-08-11 13:47:34 +0930 [def31ef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/def31ef562c0002713401652657d59320548ee85) - style(yaml_lint): fixed yaml lint errors
2021-08-04 03:23:08 +0000 [eb5cc8a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/eb5cc8a0e2885a9ed16a8d1a81611aec4d5a4d31) - build(version): bump version 0.3.0rc0 → 0.3.0rc1

View File

@ -85,8 +85,7 @@ commit footer refs:
junit:
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "development"'
- if: '$CI_COMMIT_BRANCH == "development" || $CI_COMMIT_BRANCH == "master"'
when: never
- if: '$CI_COMMIT_BRANCH && $CHANGELOG_FOOTER_REFERENCES != "False"'
when: always

View File

@ -1,5 +1,8 @@
# Changelog
2022-01-16 09:02:44 +0930 [82c6c9f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/82c6c9f5d53594544cea9a7bc59a10ab1e9ebedd) - feat(commit_footer_refs): never run on development or master.
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 14:46:26 +0930 [2ac22c0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/2ac22c0e914016a8944ff9b94640f3e87f409069) - fix(commit_footer): fix bug introduced in code quality commit
2021-08-12 14:42:16 +0930 [ccc601f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ccc601f641a9b07b63a160d779c5037481316e75) - style(cz_nfc): code quality on cz_nfc.py
2021-08-12 14:27:41 +0930 [5676c5e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5676c5ee376f574a8581e8c8f4810eb5a7c511ba) - style(commit_footer): code quality on setup.py

View File

@ -1,5 +1,7 @@
# Changelog
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 15:06:07 +0930 [4b6cc31](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4b6cc3176fc4acc3b7dbb954162802af9cbb4c68) - fix(pylint): install the required packages for files being checked
2021-08-12 14:49:00 +0930 [936299a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/936299aefc6eadf9cbfec3152b352b321969cfab) - fix(pylint): fix bug introduced in code quality commit
2021-08-12 14:04:32 +0930 [73e061e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/73e061e649e8fbeee34c6d18cf1f901b394a1f26) - build(pylint): added .pylintrc to exclude some rules

View File

@ -36,8 +36,6 @@
junit:
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: never
- if: '$CI_COMMIT_BRANCH'
when: always
- when: never

View File

@ -1,4 +1,7 @@
# Changelog
2022-01-16 09:04:52 +0930 [140985c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/140985c3a4ea07cf30f7fe8c970fb07cc61b776d) - feat(.yaml_lint_defaults): Always run on all branches as this denotes quality.
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
2021-08-11 13:41:42 +0930 [d20a56f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d20a56fa0ca492e3fc2ad7c548fc891cc8ffc8ec) - feat(yaml_lint): Added job yaml lint for checking yaml files