lazylead 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/ .dockerignore +12 -0
  3. data/.0pdd.yml +5 -0
  4. data/.circleci/config.yml +50 -0
  5. data/.circleci/release_image.sh +13 -0
  6. data/.circleci/validate.sh +10 -0
  7. data/.docker/Dockerfile +31 -0
  8. data/.docker/build.sh +6 -0
  9. data/.docker/docker-compose.yml +23 -0
  10. data/.docker/readme.md +21 -0
  11. data/.gitattributes +9 -0
  12. data/.github/CODE_OF_CONDUCT.md +76 -0
  13. data/.github/CONTRIBUTING.md +9 -0
  14. data/.github/ISSUE_TEMPLATE.md +14 -0
  15. data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  16. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  17. data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  18. data/.github/tasks.yml +24 -0
  19. data/.github/trello.md +18 -0
  20. data/.gitignore +12 -0
  21. data/.pdd +5 -0
  22. data/.rubocop.yml +87 -0
  23. data/.ruby-version +1 -0
  24. data/.rultor.yml +31 -0
  25. data/.simplecov +16 -0
  26. data/.travis.yml +16 -0
  27. data/Gemfile +27 -0
  28. data/Guardfile +33 -0
  29. data/Rakefile +93 -0
  30. data/appveyor.yml +50 -0
  31. data/bin/.ruby-version +1 -0
  32. data/bin/lazylead +99 -0
  33. data/build.sh +6 -0
  34. data/deploy.sh +16 -0
  35. data/lazylead.gemspec +106 -0
  36. data/lib/lazylead.rb +52 -0
  37. data/lib/lazylead/allocated.rb +56 -0
  38. data/lib/lazylead/cli/app.rb +87 -0
  39. data/lib/lazylead/confluence.rb +157 -0
  40. data/lib/lazylead/email.rb +74 -0
  41. data/lib/lazylead/exchange.rb +83 -0
  42. data/lib/lazylead/log.rb +71 -0
  43. data/lib/lazylead/model.rb +140 -0
  44. data/lib/lazylead/postman.rb +78 -0
  45. data/lib/lazylead/salt.rb +91 -0
  46. data/lib/lazylead/schedule.rb +88 -0
  47. data/lib/lazylead/smtp.rb +82 -0
  48. data/lib/lazylead/system/empty.rb +36 -0
  49. data/lib/lazylead/system/fake.rb +41 -0
  50. data/lib/lazylead/system/jira.rb +249 -0
  51. data/lib/lazylead/system/synced.rb +41 -0
  52. data/lib/lazylead/task/alert.rb +105 -0
  53. data/lib/lazylead/task/confluence_ref.rb +59 -0
  54. data/lib/lazylead/task/echo.rb +38 -0
  55. data/lib/lazylead/task/fix_version.rb +79 -0
  56. data/lib/lazylead/task/missing_comment.rb +53 -0
  57. data/lib/lazylead/version.rb +27 -0
  58. data/lib/messages/due_date_expired.erb +96 -0
  59. data/lib/messages/illegal_fixversion_change.erb +120 -0
  60. data/lib/messages/missing_comment.erb +128 -0
  61. data/license.txt +21 -0
  62. data/readme.md +160 -0
  63. data/test/lazylead/allocated_test.rb +51 -0
  64. data/test/lazylead/cli/app_test.rb +74 -0
  65. data/test/lazylead/confluence_test.rb +55 -0
  66. data/test/lazylead/exchange_test.rb +68 -0
  67. data/test/lazylead/model_test.rb +65 -0
  68. data/test/lazylead/salt_test.rb +42 -0
  69. data/test/lazylead/smoke_test.rb +38 -0
  70. data/test/lazylead/smtp_test.rb +65 -0
  71. data/test/lazylead/system/jira_test.rb +110 -0
  72. data/test/lazylead/task/confluence_ref_test.rb +66 -0
  73. data/test/lazylead/task/duedate_test.rb +126 -0
  74. data/test/lazylead/task/echo_test.rb +34 -0
  75. data/test/lazylead/task/fix_version_test.rb +52 -0
  76. data/test/lazylead/task/missing_comment_test.rb +56 -0
  77. data/test/lazylead/version_test.rb +36 -0
  78. data/test/sqlite_test.rb +80 -0
  79. data/test/test.rb +103 -0
  80. data/todo.yml +16 -0
  81. data/upgrades/sqlite/001-install-main-lazylead-tables.sql +63 -0
  82. data/upgrades/sqlite/999.testdata.sql +39 -0
  83. metadata +815 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 51f5479222983a306e063eb06e764100ea069e9a62854c478f9e0a14efdac5dd
4
+ data.tar.gz: 8e0052a4432740bd347c85c96267ecdc53f182e4a6716035839ad3ef5aec8d98
5
+ SHA512:
6
+ metadata.gz: 863fb878c397f0cb5b4861dae0db83ea02b9f795a4625af97c7b5426cd376e490270d98d90b1cda07fb960835fe90cb481ee6d315ecaa171221e4e3ac8ebb4e7
7
+ data.tar.gz: dd47bb278d2eef49b36820ffc9c181c87118b2d6e2a7099784ec8c17f97ed8165af1f3d01615ef8e4011c374d5054c4b74389e8b4625777db53798e63da48585
@@ -0,0 +1,12 @@
1
+ .docker
2
+ .github
3
+ /coverage
4
+ /test
5
+ *.yml
6
+ *.sh
7
+ .gitignore
8
+ .gitattributes
9
+ .pdd
10
+ .ruby-version
11
+ .simplecov
12
+ *.log
@@ -0,0 +1,5 @@
1
+ errors:
2
+ - yurii.dubinka@gmail.com
3
+
4
+ tags:
5
+ - pdd
@@ -0,0 +1,50 @@
1
+ # @todo #/DEV Define automatic integration between rultor and Circle CI.
2
+ # Right not its not clear how to automatically accept the merge requests into master.
3
+ # Without this integration the release history won't be clear.
4
+ version: 2
5
+ jobs:
6
+ test:
7
+ docker:
8
+ - image: ruby:2.6.5-alpine
9
+ steps:
10
+ - checkout
11
+ - run: |
12
+ apk add libc-dev gcc make git sqlite sqlite-dev sqlite-libs
13
+ bundler install
14
+ - run: rake test rubocop xcop
15
+ deploy:
16
+ machine: true
17
+ steps:
18
+ - checkout
19
+ # build the application image
20
+ - run:
21
+ name: "Build docker image"
22
+ command: |
23
+ set -e
24
+ COMMIT_URL="https://github.com/dgroup/rll/commit/${CIRCLE_SHA1}"
25
+ docker build --build-arg release_tags="${CIRCLE_SHA1}, ${CIRCLE_BRANCH}, ${COMMIT_URL}" \
26
+ -t dgroup/lazylead:$CIRCLE_BRANCH . \
27
+ -f .docker/Dockerfile
28
+ docker run --rm dgroup/lazylead:${CIRCLE_BRANCH} bin/lazylead --verbose > trace.log
29
+ cat trace.log
30
+ expected="No tasks found"
31
+ echo "Ensure that app prints the line '${expected}'."
32
+ grep --color "${expected}" trace.log
33
+ # publish the image
34
+ - run:
35
+ name: "Deploy docker image"
36
+ command: |
37
+ chmod +x .circleci/release_image.sh
38
+ .circleci/release_image.sh
39
+ workflows:
40
+ version: 2
41
+ build_and_test:
42
+ jobs:
43
+ - test
44
+ - deploy:
45
+ filters:
46
+ branches:
47
+ only:
48
+ - master
49
+ requires:
50
+ - test
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+ export docker_release_tags="latest 1 1.0.1 0.1.1"
3
+ docker login --username $DOCKER_USER --password $DOCKER_TOKEN
4
+ if [ "${CIRCLE_BRANCH}" == "master" ]; then
5
+ for tag in ${docker_release_tags// / } ; do
6
+ docker tag dgroup/lazylead:$CIRCLE_BRANCH dgroup/lazylead:${tag}
7
+ docker push dgroup/lazylead:${tag}
8
+ echo "dgroup/lazylead:${tag} released"
9
+ done
10
+ else
11
+ docker push dgroup/lazylead:$CIRCLE_BRANCH
12
+ echo "dgroup/lazylead:${CIRCLE_BRANCH} released"
13
+ fi
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Verify that Circle CI config is valid.
4
+ # - https://support.circleci.com/hc/en-us/articles/360006735753-Validating-your-CircleCI-Configuration
5
+ # - https://circleci.com/docs/2.0/local-cli/
6
+ #
7
+ # For OSX you need to install the command-line client
8
+ # brew install circleci
9
+ #
10
+ circleci config validate config.yml
@@ -0,0 +1,31 @@
1
+ FROM ruby:2.6.5-alpine
2
+
3
+ ARG release_tags
4
+
5
+ LABEL about="https://github.com/dgroup/lazylead" \
6
+ ci.contact="yurii.dubinka@gmail.com" \
7
+ ci.release.tag="${release_tags}" \
8
+ ll.docker.issues="https://github.com/dgroup/lazylead/issues?utf8=✓&q=label%3Adocker"
9
+
10
+ ENV APP_HOME=/lazylead \
11
+ version=${release_tags}
12
+
13
+ WORKDIR $APP_HOME
14
+
15
+ # @todo #/DEV The current image size is about 150MB.
16
+ # The original alpine image is ~20MB.
17
+ # Image cleanup is required.
18
+ RUN echo "Install 3rd-party libraries." \
19
+ && apk add libc-dev gcc make git sqlite sqlite-dev sqlite-libs tree less vim man bash unzip
20
+
21
+ COPY Gemfile lazylead.gemspec ./
22
+
23
+ RUN bundler install
24
+
25
+ COPY bin/lazylead ./bin/lazylead
26
+ ADD lib ./lib
27
+ ADD upgrades ./upgrades
28
+
29
+ CMD ["bin/lazylead", "--trace", "--verbose", "--memory-dump"]
30
+
31
+ MAINTAINER 'Yurii Dubinka (yurii.dubinka@gmail.com)'
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ echo ""
3
+ set -e
4
+ config=docker-compose.yml
5
+ clear
6
+ docker-compose -f ${config} rm --force && docker-compose -f ${config} up --build
@@ -0,0 +1,23 @@
1
+ version: '2.3'
2
+
3
+ # @todo #/DEV Define openshift template in order to deploy into Openshift/Kubernetes/etcN environment.
4
+ services:
5
+
6
+ lazylead:
7
+ image: dgroup/lazylead:latest
8
+ container_name: lazylead
9
+ mem_limit: 128m
10
+ build:
11
+ context: ../
12
+ dockerfile: .docker/Dockerfile
13
+ environment:
14
+ # @todo #/DEV Add SHA2, version, release date, and url to commit.
15
+ release_tags: "0.1.0"
16
+ ports:
17
+ - 82:8080
18
+ - 1082:1082 # remote debug
19
+ - 1282:1282 # JMX connection for jvisualvm debug
20
+ volumes:
21
+ - .local/dumps:/lazylead/dumps
22
+ - .local/logs:/lazylead/logs
23
+ entrypoint: bin/lazylead --trace --verbose
@@ -0,0 +1,21 @@
1
+ #### Docker F.A.Q.
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
+ - Monitoring
15
+ ```bash
16
+ # Display on-line information regarding system usage (CPU,RAM,IO) per container
17
+ docker stats $(docker ps --format '{{.Names}}')
18
+ docker stats $(docker ps | awk '{if(NR>1) print $NF}')
19
+ ```
20
+ - [Cheat sheet](https://gist.github.com/dgroup/5046bac5531fae11242dd03201626f5b)
21
+ - [Basics](https://github.com/wsargent/docker-cheat-sheet)
@@ -0,0 +1,9 @@
1
+ # Check out all text files in UNIX format, with LF as end of line
2
+ # Don't change this file. If you have any ideas about it, please
3
+ # submit a separate issue about it and we'll discuss.
4
+
5
+ * text=auto eol=lf
6
+ *.rb ident
7
+ *.xml ident
8
+ *.png binary
9
+ *.pdf binary
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the github@dgroup. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
@@ -0,0 +1,9 @@
1
+ Just send a pull request and call it a day.
2
+
3
+
4
+
5
+
6
+
7
+ Only if the build is green, you send us your pull request.
8
+
9
+ Thanks!
@@ -0,0 +1,14 @@
1
+ Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points:
2
+
3
+ - You have all pre-requisites listed in README.md installed
4
+ - You are sure that you are not reporting a duplicate (search all issues)
5
+ - You say "is broken" or "doesn't work" in the title
6
+ - You tell us what you are trying to do
7
+ - You explain the results you are getting
8
+ - You suggest an alternative result you would like to see
9
+
10
+ These articles will help you understand what we are looking for:
11
+ * http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html
12
+ * https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
13
+
14
+ Thank you for your contribution!
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,11 @@
1
+ Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist:
2
+
3
+ - You made a small amount of changes (less than 100 lines, less than 10 files)
4
+ - You made changes related to only one bug (create separate PRs for separate problems)
5
+ - You are ready to defend your changes (there will be a code review)
6
+ - You don't touch what you don't understand
7
+ - You ran the build locally and it passed
8
+
9
+ This article will help you understand what we are looking for: http://www.yegor256.com/2015/02/09/serious-code-reviewer.html
10
+
11
+ Thank you for your contribution!
@@ -0,0 +1,24 @@
1
+ version: '2.3'
2
+ services:
3
+
4
+ lazylead:
5
+ image: dgroup/lazylead:latest
6
+ container_name: lazylead
7
+ mem_limit: 128m
8
+ environment:
9
+ # The jira server details.
10
+ # Please ensure that your jira filter(s) grants this user to see issues.
11
+ # Sometimes jira filter(s) may be created with restricted visibility, thus
12
+ # lazylead can't find the issues.
13
+ jira_url: https://jira.spring.io
14
+ jira_user: theuser
15
+ jira_password: thepass
16
+ # The MS Exchange server details, please ensure that '/ews/Exchange.asm`
17
+ # will be after your server url. Just change the url to your server.
18
+ exchange_url: https://your.ms.exchange.server/ews/Exchange.asmx
19
+ exchange_user: theuser
20
+ exchange_password: the password
21
+ volumes:
22
+ - ./:/lazylead/db
23
+ # db/ll.db is sqlite file with jira related annoying tasks
24
+ entrypoint: bin/lazylead --sqlite db/ll.db --trace --verbose
@@ -0,0 +1,18 @@
1
+ ###Trello Development guide
2
+
3
+ **Enable integration requsites**\
4
+ Before start testing integration with Trello you need to retrieve *API key* and *API token* from Trello by following link https://developers.trello.com/page/authorization
5
+
6
+ **Environment Variables**\
7
+ To run tests with integration to Trello you have to setup following environment variables:
8
+
9
+ Varable|Description
10
+ --- | ---
11
+ |*TRELLO_BOARD*| your existing board in Trello
12
+ |*TRELLO_KEY* | your API key
13
+ |*TRELLO_TOKEN*|you API token
14
+
15
+ Example:
16
+ ```bash
17
+ mvn -P quilice clean install -DTRELLO_KEY={TRELLO_KEY} -DTRELLO_TOKEN={TRELLO_TOKEN} -DTRELLO_BOARD={TRELLO_BOARD}
18
+ ```
@@ -0,0 +1,12 @@
1
+ coverage/
2
+ Gemfile.lock
3
+ *.gem
4
+ .bundle/
5
+ .DS_Store
6
+ rdoc/
7
+ *.db
8
+ *.lock
9
+ *.log
10
+ *.iml
11
+ *.iws
12
+ /.idea/
data/.pdd ADDED
@@ -0,0 +1,5 @@
1
+ --source=.
2
+ --verbose
3
+ --exclude target/**/*
4
+ --exclude coverage/**/*
5
+ --rule min-words:5