lazylead 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -7
- data/.circleci/release_image.sh +10 -7
- data/.docker/Dockerfile +10 -9
- data/.docker/docker-compose.yml +3 -3
- data/.docker/readme.md +24 -21
- data/.docker/vcs.dockerfile +10 -0
- data/.docs/duedate_expired.md +92 -0
- data/.docs/propagate_down.md +89 -0
- data/.rubocop.yml +1 -1
- data/.rultor.yml +13 -14
- data/.simplecov +0 -6
- data/CNAME +1 -0
- data/Rakefile +38 -1
- data/bin/lazylead +7 -2
- data/lazylead.gemspec +5 -17
- data/lib/lazylead/cc.rb +180 -0
- data/lib/lazylead/cli/app.rb +4 -3
- data/lib/lazylead/exchange.rb +14 -1
- data/lib/lazylead/home.rb +38 -0
- data/lib/lazylead/model.rb +29 -7
- data/lib/lazylead/postman.rb +14 -14
- data/lib/lazylead/schedule.rb +4 -2
- data/lib/lazylead/system/fake.rb +1 -1
- data/lib/lazylead/system/jira.rb +46 -5
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/task/propagate_down.rb +118 -0
- data/lib/lazylead/task/savepoint.rb +58 -0
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/due_date_expired.erb +8 -7
- data/lib/messages/illegal_fixversion_change.erb +9 -8
- data/lib/messages/missing_comment.erb +10 -9
- data/lib/messages/savepoint.erb +43 -0
- data/readme.md +98 -82
- data/test/lazylead/cc_test.rb +153 -0
- data/test/lazylead/cli/app_test.rb +1 -2
- data/test/lazylead/exchange_test.rb +20 -0
- data/test/lazylead/model_test.rb +11 -0
- data/test/lazylead/postman_test.rb +57 -0
- data/test/lazylead/system/jira_test.rb +8 -0
- data/test/lazylead/task/assignee_alert_test.rb +47 -0
- data/test/lazylead/task/duedate_test.rb +20 -8
- data/test/lazylead/task/fix_version_test.rb +2 -4
- data/test/lazylead/task/missing_comment_test.rb +2 -4
- data/test/lazylead/task/propagate_down_test.rb +86 -0
- data/test/lazylead/task/savepoint_test.rb +51 -0
- data/test/test.rb +11 -0
- data/upgrades/sqlite/001-install-main-lazylead-tables.sql +3 -4
- data/upgrades/sqlite/999.testdata.sql +7 -2
- metadata +38 -175
- data/deploy.sh +0 -16
- data/todo.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4564fa672731c29fe8e9dc32d2f09c56bf0b9245fce2900b4335c49442d08fb2
|
4
|
+
data.tar.gz: 58ff724cc12437d3106978913f0c2ef12a189f2e80b87ec07a2202bcd0f90267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b23097dca908102e6863d5527769bfe3d5405003cbab920da7ee6fd7f4118b554eb3d3a5f1170830dfdbf8fb08f752e6276fae4157f919f6e39ec070a91089
|
7
|
+
data.tar.gz: be8745b87907ab9ad30e9e4eb67f0ebf44ae0dcc01dcdbedefd79ab480e1222bbdc8835a397d465b5e491e995ee7ceaf685464385d7d87c0f0014900325d38ac
|
data/.circleci/config.yml
CHANGED
@@ -11,31 +11,43 @@ jobs:
|
|
11
11
|
- run: |
|
12
12
|
apk add libc-dev gcc make git sqlite sqlite-dev sqlite-libs
|
13
13
|
bundler install
|
14
|
-
- run: rake test rubocop xcop
|
14
|
+
- run: bundle exec rake test rubocop sqlint xcop
|
15
15
|
deploy:
|
16
16
|
machine: true
|
17
17
|
steps:
|
18
18
|
- checkout
|
19
|
-
# build the application image
|
20
19
|
- run:
|
21
|
-
name: "Build
|
20
|
+
name: "Build LL image"
|
22
21
|
command: |
|
23
22
|
set -e
|
24
|
-
COMMIT_URL="https://github.com/dgroup/
|
25
|
-
|
23
|
+
COMMIT_URL="https://github.com/dgroup/lazylead/commit/${CIRCLE_SHA1}"
|
24
|
+
sed -i "s/0\.0\.0/${DOCKER_RELEASE_TAGS}/g" lib/lazylead/version.rb
|
25
|
+
docker build --build-arg release_tags="${CIRCLE_SHA1}, ${CIRCLE_BRANCH}, ${COMMIT_URL}" --build-arg version="${DOCKER_RELEASE_TAGS:7}" \
|
26
26
|
-t dgroup/lazylead:$CIRCLE_BRANCH . \
|
27
27
|
-f .docker/Dockerfile
|
28
|
+
echo "Available LL images:"
|
29
|
+
docker images | grep lazylead
|
28
30
|
docker run --rm dgroup/lazylead:${CIRCLE_BRANCH} bin/lazylead --verbose > trace.log
|
29
31
|
cat trace.log
|
30
32
|
expected="No tasks found"
|
31
33
|
echo "Ensure that app prints the line '${expected}'."
|
32
34
|
grep --color "${expected}" trace.log
|
33
|
-
# publish the image
|
34
35
|
- run:
|
35
|
-
name: "
|
36
|
+
name: "Push LL image"
|
36
37
|
command: |
|
37
38
|
chmod +x .circleci/release_image.sh
|
38
39
|
.circleci/release_image.sh
|
40
|
+
- run:
|
41
|
+
name: "Build & push LL VCS image"
|
42
|
+
command: |
|
43
|
+
sed -i "s/0\.0\.0/${DOCKER_RELEASE_TAGS}/g" .docker/vcs.dockerfile
|
44
|
+
sed -i "s/0\.0\.0/${DOCKER_RELEASE_TAGS}/g" lib/lazylead/version.rb
|
45
|
+
docker build -t dgroup/lazylead:${DOCKER_RELEASE_TAGS}-vcs . -f .docker/vcs.dockerfile
|
46
|
+
docker push dgroup/lazylead:${DOCKER_RELEASE_TAGS}-vcs
|
47
|
+
- run:
|
48
|
+
name: "Reset tag to master"
|
49
|
+
command: |
|
50
|
+
curl -s -X POST -u ${CI_TOKEN}:"" --url "https://circleci.com/api/v2/project/gh/dgroup/lazylead/envvar" -H "accept: application/json" -H "content-type: application/json" -d "{ \"name\": \"DOCKER_RELEASE_TAGS\", \"value\": \"master\" }"
|
39
51
|
workflows:
|
40
52
|
version: 2
|
41
53
|
build_and_test:
|
data/.circleci/release_image.sh
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
|
3
|
-
|
2
|
+
set -e
|
3
|
+
echo "Release tags: ${DOCKER_RELEASE_TAGS}"
|
4
|
+
docker login --username "${DOCKER_USER}" --password "${DOCKER_TOKEN}"
|
4
5
|
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
5
|
-
for tag in ${
|
6
|
-
docker tag dgroup/lazylead:$CIRCLE_BRANCH dgroup/lazylead:${tag}
|
7
|
-
docker push dgroup/lazylead:${tag}
|
6
|
+
for tag in ${DOCKER_RELEASE_TAGS// / } ; do
|
7
|
+
docker tag "dgroup/lazylead:${CIRCLE_BRANCH}" "dgroup/lazylead:${tag}"
|
8
|
+
docker push "dgroup/lazylead:${tag}"
|
8
9
|
echo "dgroup/lazylead:${tag} released"
|
9
10
|
done
|
10
11
|
else
|
11
|
-
docker push dgroup/lazylead:$CIRCLE_BRANCH
|
12
|
+
docker push "dgroup/lazylead:${CIRCLE_BRANCH}"
|
12
13
|
echo "dgroup/lazylead:${CIRCLE_BRANCH} released"
|
13
|
-
fi
|
14
|
+
fi
|
15
|
+
echo "Available LL images:"
|
16
|
+
docker images | grep lazylead
|
data/.docker/Dockerfile
CHANGED
@@ -1,31 +1,32 @@
|
|
1
1
|
FROM ruby:2.6.5-alpine
|
2
2
|
|
3
3
|
ARG release_tags
|
4
|
+
ARG version
|
4
5
|
|
5
6
|
LABEL about="https://github.com/dgroup/lazylead" \
|
6
7
|
ci.contact="yurii.dubinka@gmail.com" \
|
7
8
|
ci.release.tag="${release_tags}" \
|
8
9
|
ll.docker.issues="https://github.com/dgroup/lazylead/issues?utf8=✓&q=label%3Adocker"
|
9
10
|
|
10
|
-
ENV APP_HOME=/lazylead
|
11
|
-
version=${release_tags}
|
11
|
+
ENV APP_HOME=/lazylead
|
12
12
|
|
13
13
|
WORKDIR $APP_HOME
|
14
14
|
|
15
|
-
# @todo #/DEV
|
15
|
+
# @todo #/DEV Original size of lazylead was 350 MB.
|
16
|
+
# After removing of unnecessary libraries it took 250 MB.
|
16
17
|
# The original alpine image is ~20MB.
|
17
18
|
# Image cleanup is required.
|
18
19
|
RUN echo "Install 3rd-party libraries." \
|
19
|
-
&& apk add libc-dev gcc make
|
20
|
+
&& apk add --no-cache libc-dev gcc git make sqlite sqlite-dev sqlite-libs tree
|
20
21
|
|
21
22
|
COPY Gemfile lazylead.gemspec ./
|
22
23
|
|
23
|
-
RUN bundler install
|
24
|
+
RUN bundler install --without development
|
24
25
|
|
25
26
|
COPY bin/lazylead ./bin/lazylead
|
26
|
-
|
27
|
-
|
27
|
+
COPY lib ./lib
|
28
|
+
COPY upgrades ./upgrades
|
28
29
|
|
29
|
-
|
30
|
+
RUN sed -i "s/0\.0\.0/${version}/g" lib/lazylead/version.rb
|
30
31
|
|
31
|
-
|
32
|
+
CMD ["bin/lazylead", "--trace", "--verbose"]
|
data/.docker/docker-compose.yml
CHANGED
@@ -10,9 +10,9 @@ services:
|
|
10
10
|
build:
|
11
11
|
context: ../
|
12
12
|
dockerfile: .docker/Dockerfile
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
args:
|
14
|
+
release_tags: "latest 0.1.0"
|
15
|
+
version: "0.1.0"
|
16
16
|
ports:
|
17
17
|
- 82:8080
|
18
18
|
- 1082:1082 # remote debug
|
data/.docker/readme.md
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#### Docker
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
#### Docker FAQ
|
2
|
+
- Prepare environment
|
3
|
+
````bash
|
4
|
+
docker start <container_name> # start particular container
|
5
|
+
docker start -i <container_name> # start particular container in interactive mode
|
6
|
+
docker stop <container_name> # stop particular container
|
7
|
+
docker ps # display all running containers
|
8
|
+
docker ps -a # display all existing containers (stopped)
|
9
|
+
docker exec -it <container_name> /bin/bash # join to the container via bash
|
10
|
+
docker rm <container_name> # remove particular container
|
11
|
+
docker rmi <image_name> # remove particular image
|
12
|
+
docker pull <image_name> # download particular image from the remote repository (NC Artifactory, dockerhub, etc)
|
13
|
+
````
|
14
|
+
|
15
|
+
- Monitoring
|
16
|
+
```bash
|
17
|
+
# Display on-line information regarding system usage (CPU,RAM,IO) per container
|
18
|
+
docker stats $(docker ps --format '{{.Names}}')
|
19
|
+
docker stats $(docker ps | awk '{if(NR>1) print $NF}')
|
20
|
+
```
|
21
|
+
|
22
|
+
- [Cheat sheet](https://gist.github.com/dgroup/5046bac5531fae11242dd03201626f5b)
|
23
|
+
|
24
|
+
- [Basics](https://github.com/wsargent/docker-cheat-sheet)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
FROM dgroup/lazylead:0.0.0
|
2
|
+
|
3
|
+
LABEL about="https://github.com/dgroup/lazylead" \
|
4
|
+
ci.contact="yurii.dubinka@gmail.com" \
|
5
|
+
ci.release.tag="${release_tags}" \
|
6
|
+
ll.docker.issues="https://github.com/dgroup/lazylead/issues?utf8=✓&q=label%3Adocker"
|
7
|
+
|
8
|
+
RUN apk add --no-cache subversion git mercurial
|
9
|
+
|
10
|
+
CMD ["bin/lazylead", "--trace", "--verbose"]
|
@@ -0,0 +1,92 @@
|
|
1
|
+
## Notify Jira ticket assignee about expired(ing) due date
|
2
|
+
#### Why?
|
3
|
+
Why do we need this if Jira has `Filter Subscription` feature:
|
4
|
+
- https://confluence.atlassian.com/jira064/receiving-search-results-via-email-720416706.html
|
5
|
+
- https://confluence.atlassian.com/jiracorecloud/advanced-searching-765593707.html
|
6
|
+
|
7
|
+
As far as I know, filter subscription feature doesn't allow(for now) to group tickets by assignee and send to each of them personal message with missing due dates.
|
8
|
+
Right now its just send whole list of tickets to you or specified group.
|
9
|
+
In worst cases, shared responsibility leads to irresponsibility each individual.
|
10
|
+
|
11
|
+
#### How to use lazylead for this
|
12
|
+
Let's assume that
|
13
|
+
1. JQL for tickets with expired due dates: `project = PRJ and resolution = unresolved and duedate < startOfDay()`
|
14
|
+
2. you've saved this JQL as jira filter with id `222`
|
15
|
+
3. you want to sent an email notification to each assignee about his/her missing due dates over `MS Exchange server`
|
16
|
+
|
17
|
+
For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
18
|
+
1. Define yml file with `docker-compose` configuration in `lazylead.yml`
|
19
|
+
```yml
|
20
|
+
version: '2.3'
|
21
|
+
services:
|
22
|
+
lazylead:
|
23
|
+
image: dgroup/lazylead:latest
|
24
|
+
container_name: lazylead
|
25
|
+
mem_limit: 128m
|
26
|
+
environment:
|
27
|
+
# The jira server details.
|
28
|
+
# Please ensure that your jira filter(s) grants this user to see issues.
|
29
|
+
# Sometimes jira filter(s) may be created with restricted visibility, thus
|
30
|
+
# lazylead can't find the issues.
|
31
|
+
jira_url: https://your.jira.com
|
32
|
+
jira_user: theuser
|
33
|
+
jira_password: thepass
|
34
|
+
# The MS Exchange server details, please ensure that '/ews/Exchange.asm`
|
35
|
+
# will be after your server url. Just change the url to your server.
|
36
|
+
exchange_url: https://your.ms.exchange.server/ews/Exchange.asmx
|
37
|
+
exchange_user: theuser
|
38
|
+
exchange_password: the password
|
39
|
+
volumes:
|
40
|
+
- ./:/lazylead/db
|
41
|
+
# db/ll.db is sqlite file with jira related annoying tasks
|
42
|
+
entrypoint: bin/lazylead --sqlite db/ll.db --trace --verbose
|
43
|
+
```
|
44
|
+
|
45
|
+
2. Create a container, using `docker-compose -f lazylead.yml up`
|
46
|
+
The container will stop as there were no tasks provided:
|
47
|
+
```bash
|
48
|
+
ll > docker-compose -f lazylead.yml up
|
49
|
+
Creating lazylead ... done
|
50
|
+
Attaching to lazylead
|
51
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at start is 52MB
|
52
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
|
53
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
|
54
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database connection established
|
55
|
+
lazylead | [2020-06-06T10:35:13] WARN SMTP connection enabled in test mode.
|
56
|
+
lazylead | [2020-06-06T10:35:13] WARN ll-001: No tasks found.
|
57
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at the end is 66MB
|
58
|
+
lazylead exited with code 0
|
59
|
+
ll >
|
60
|
+
```
|
61
|
+
|
62
|
+
3. Define your team and tasks in database.
|
63
|
+
The tables structure defined [here](../upgrades/sqlite/001-install-main-lazylead-tables.sql).
|
64
|
+
Modify you [sqlite](https://sqlite.com/index.html) file(`ll.db`) using [DB Browser](https://sqlitebrowser.org/) or any similar tool.
|
65
|
+
You may add your email into tasks.properties `"cc":"your@email.com"` in order to be aware that developer got the message, but i don't recommend you as you'll get a dozen of messages in a few days :) .
|
66
|
+
```sql
|
67
|
+
insert into teams (id, name, properties)
|
68
|
+
values (1, 'Dream team with lazylead', '{}');
|
69
|
+
insert into systems(id, properties)
|
70
|
+
values (1,'{"type":"Lazylead::Jira", "username":"${jira_user}", "password":"${jira_password}", "site":"${jira_url}", "context_path":""}');
|
71
|
+
insert into tasks (name, cron, enabled, id, system, team_id, action, properties)
|
72
|
+
values ('Expired due dates',
|
73
|
+
'0 8 * * 1-5',
|
74
|
+
'true',
|
75
|
+
1, 1, 1,
|
76
|
+
'Lazylead::Task::AssigneeAlert',
|
77
|
+
'{"sql":"filter=222", "cc":"<youremail.com>", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}');
|
78
|
+
|
79
|
+
```
|
80
|
+
Yes, for task scheduling we are using [cron](https://crontab.guru).
|
81
|
+
|
82
|
+
4. Once you changed `./ll.db`, please restart the container using `docker-compose -f .github/tasks.yml restart`
|
83
|
+
```bash
|
84
|
+
ll > docker-compose -f .github/tasks.yml restart
|
85
|
+
Restarting lazylead ... done
|
86
|
+
```
|
87
|
+
|
88
|
+
|
89
|
+
#### Where is the code?
|
90
|
+
| Logic | Tests | Email Template |
|
91
|
+
| :-----: | :------: | :-----: |
|
92
|
+
| AssigneeAlert in [alert.rb](../lib/lazylead/task/alert.rb)| [duedate_test.rb](../test/lazylead/task/duedate_test.rb) | [due_date_expired.erb](../lib/messages/due_date_expired.erb) |
|
@@ -0,0 +1,89 @@
|
|
1
|
+
## Propagate fields from parent Jira ticket to sub-tasks
|
2
|
+
#### Why?
|
3
|
+
Why do we need this if Jira has automation already?
|
4
|
+
|
5
|
+
Could you able use this feature right now? Just right now, without requests to some admin/jira owner/submitting some tickets to someone/etc... I doubt.
|
6
|
+
In a huge company that's almost impossible to change something special for you in short terms.
|
7
|
+
|
8
|
+
#### How to use lazylead for this
|
9
|
+
Let's assume that
|
10
|
+
1. JQL for parent tickets for the propagation: `issue in parentsOf("project='PRJ' and 'External ID' is empty") and "External ID" is not empty and updated >-1d`.
|
11
|
+
2. you've saved this JQL as jira filter with id `222`.
|
12
|
+
|
13
|
+
For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
14
|
+
1. Define yml file with `docker-compose` configuration in `lazylead.yml`
|
15
|
+
```yml
|
16
|
+
version: '2.3'
|
17
|
+
services:
|
18
|
+
lazylead:
|
19
|
+
image: dgroup/lazylead:latest
|
20
|
+
container_name: lazylead
|
21
|
+
mem_limit: 128m
|
22
|
+
environment:
|
23
|
+
# The jira server details.
|
24
|
+
# Please ensure that your jira filter(s) grants this user to see issues.
|
25
|
+
# Sometimes jira filter(s) may be created with restricted visibility, thus
|
26
|
+
# lazylead can't find the issues.
|
27
|
+
jira_url: https://your.jira.com
|
28
|
+
jira_user: theuser
|
29
|
+
jira_password: thepass
|
30
|
+
volumes:
|
31
|
+
- ./:/lazylead/db
|
32
|
+
# db/ll.db is sqlite file with jira related annoying tasks
|
33
|
+
entrypoint: bin/lazylead --sqlite db/ll.db --trace --verbose
|
34
|
+
```
|
35
|
+
|
36
|
+
2. Create a container, using `docker-compose -f lazylead.yml up`
|
37
|
+
The container will stop as there were no tasks provided:
|
38
|
+
```bash
|
39
|
+
ll > docker-compose -f lazylead.yml up
|
40
|
+
Creating lazylead ... done
|
41
|
+
Attaching to lazylead
|
42
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at start is 52MB
|
43
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
|
44
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
|
45
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database connection established
|
46
|
+
lazylead | [2020-06-06T10:35:13] WARN SMTP connection enabled in test mode.
|
47
|
+
lazylead | [2020-06-06T10:35:13] WARN ll-001: No tasks found.
|
48
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at the end is 66MB
|
49
|
+
lazylead exited with code 0
|
50
|
+
ll >
|
51
|
+
```
|
52
|
+
|
53
|
+
3. Define your team and tasks in database.
|
54
|
+
The tables structure defined [here](../upgrades/sqlite/001-install-main-lazylead-tables.sql).
|
55
|
+
Modify you [sqlite](https://sqlite.com/index.html) file(`ll.db`) using [DB Browser](https://sqlitebrowser.org/) or any similar tool.
|
56
|
+
```sql
|
57
|
+
insert into teams (id, name, properties)
|
58
|
+
values (1, 'Dream team with lazylead', '{}');
|
59
|
+
insert into systems(id, properties)
|
60
|
+
values (1,'{"type":"Lazylead::Jira", "username":"${jira_user}", "password":"${jira_password}", "site":"${jira_url}", "context_path":""}');
|
61
|
+
insert into tasks (name, cron, enabled, id, system, team_id, action, properties)
|
62
|
+
values ('Propagate customfield_1 (External ID) to sub-tasks',
|
63
|
+
'0 8 * * 1-5',
|
64
|
+
'true',
|
65
|
+
1, 1, 1,
|
66
|
+
'Lazylead::Task::PropagateDown',
|
67
|
+
'{"jql":"filter=222", "fields":"customfield_1"}');
|
68
|
+
|
69
|
+
```
|
70
|
+
Yes, for task scheduling we are using [cron](https://crontab.guru).
|
71
|
+
|
72
|
+
4. Once you changed `./ll.db`, please restart the container using `docker-compose -f .github/tasks.yml restart`
|
73
|
+
```bash
|
74
|
+
ll > docker-compose -f .github/tasks.yml restart
|
75
|
+
Restarting lazylead ... done
|
76
|
+
```
|
77
|
+
|
78
|
+
5. Once task completed, please check your sub-tasks, they should have `customfield_1` and comment like
|
79
|
+
```text
|
80
|
+
The following fields were propagated from <parent-ticket-key>:
|
81
|
+
||Field||Value||
|
82
|
+
|customfield_1|<parent-field-value>|
|
83
|
+
Posted by [lazylead v0.0.0|https://bit.ly/2NjdndS]]
|
84
|
+
```
|
85
|
+
|
86
|
+
#### Where is the code?
|
87
|
+
| Logic | Tests |
|
88
|
+
| :-----: | :------: |
|
89
|
+
| [propagate_down.rb](../lib/lazylead/task/propagate_down.rb)| [propagate_down_test.rb](../test/lazylead/task/propagate_down_test.rb) |
|
data/.rubocop.yml
CHANGED
data/.rultor.yml
CHANGED
@@ -1,31 +1,30 @@
|
|
1
|
+
architect:
|
2
|
+
- dgroup
|
1
3
|
assets:
|
2
|
-
rubygems.yml: dgroup/
|
4
|
+
rubygems.yml: dgroup/home#rubygems.yml
|
5
|
+
circleci.header: dgroup/home#circleci.header
|
3
6
|
install: |
|
4
7
|
export GEM_HOME=~/.ruby
|
5
8
|
export GEM_PATH=$GEM_HOME:$GEM_PATH
|
6
|
-
|
7
|
-
|
8
|
-
sudo gem install pdd -v 0.20.5
|
9
|
+
docker:
|
10
|
+
image: ruby:2.6.5
|
9
11
|
release:
|
10
12
|
script: |-
|
13
|
+
set -e
|
11
14
|
export RUBYOPT="-W0"
|
12
15
|
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
13
16
|
sed -i "s/0\.0\.0/${tag}/g" lib/lazylead/version.rb
|
17
|
+
sed -i "s/0\.0\.0/${tag}/g" lazylead.gemspec
|
14
18
|
bundle install --no-color
|
15
|
-
rake --
|
16
|
-
git add lib/lazylead/version.rb
|
19
|
+
bundle exec rake --trace test rubocop sqlint xcop
|
20
|
+
git add lib/lazylead/version.rb lazylead.gemspec
|
17
21
|
git commit -m "version set to ${tag}"
|
18
22
|
gem build lazylead.gemspec
|
19
23
|
chmod 0600 ../rubygems.yml
|
20
24
|
gem push *.gem --config-file ../rubygems.yml
|
21
|
-
|
22
|
-
- dgroup
|
25
|
+
curl -s -X POST --url "https://circleci.com/api/v2/project/gh/dgroup/lazylead/envvar" -H @../circleci.header -H "accept: application/json" -H "content-type: application/json" -d "{ \"name\": \"DOCKER_RELEASE_TAGS\", \"value\": \"${tag}\" }" -o /dev/null
|
26
|
+
curl -s -X POST --url https://circleci.com/api/v2/project/gh/dgroup/lazylead/pipeline -H @../circleci.header -H 'accept: application/json' -H 'content-type: application/json' -H 'x-attribution-login: dgroup' -o /dev/null
|
23
27
|
merge:
|
24
28
|
script: |-
|
25
29
|
bundle install
|
26
|
-
rake
|
27
|
-
pdd -f /dev/null -v
|
28
|
-
deploy:
|
29
|
-
script: |-
|
30
|
-
echo "There is nothing to deploy"
|
31
|
-
exit -1
|
30
|
+
bundle exec rake test rubocop sqlint xcop
|
data/.simplecov
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
# @todo #/DEV Increase code coverage from 75% to 80%+.
|
4
|
-
# Right now it was decreased to 75% due to long manual setup of
|
5
|
-
# dev. instances of Atlassian Jira and Confluence.
|
6
|
-
# It was configured locally and there is no automation for now how
|
7
|
-
# it can be included quickly into CI process. This need to be done later.
|
8
|
-
|
9
3
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
10
4
|
[SimpleCov::Formatter::HTMLFormatter]
|
11
5
|
)
|