-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jpmoura/release/v0.1.0
Release/v0.1.0
- Loading branch information
Showing
32 changed files
with
1,415 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PAT="azureDevOpsPersonalAccessToken" | ||
PROJECT_NAME="Project" | ||
TEAM_NAME="Project Product Team" | ||
ORGANIZATION_NAME="ACME" | ||
DEVOPS_USER="a.devops.user.with.access@user.com" | ||
DEVOPS_PASSWORD="the.password" | ||
SMTP_USER="user@host.com" | ||
SMTP_PASSWORD="super.secret.password" | ||
SMTP_HOST="smtp.host.com" | ||
SMTP_PORT=587 | ||
EMAIL_RECIPIENTS="stackholer@acme.com,another.stackholder@acme.com" | ||
EMAIL_CARBON_COPY_RECIPIENTS="team.member@team.com,another.team.member@team.com" | ||
DEBUG=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules | ||
lib | ||
dist | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"jest" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:jest/all" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"class-methods-use-this": 0 | ||
} | ||
} | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"jest" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:jest/all" | ||
], | ||
"parserOptions": { | ||
"project": "tsconfig.json" | ||
}, | ||
"rules": { | ||
"max-len": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "pwa-node", | ||
"request": "launch", | ||
"name": "Debug", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"preLaunchTask": "tsc: build - tsconfig.json", | ||
"program": "${workspaceFolder}\\src\\index.ts", | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**/*.js" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"typescript", | ||
"typescriptreact" | ||
], | ||
"eslint.alwaysShowStatus": true, | ||
"eslint.packageManager": "yarn", | ||
"cSpell.words": [ | ||
"burndown", | ||
"tslog" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,71 @@ | ||
# azure-devops-sprint-daily-report | ||
An automatic application that sends daily reports based on Azure DevOps information | ||
# 📄 azure-devops-sprint-daily-report | ||
This is an automatic application that sends daily reports based on Azure DevOps information built with Node.js using TypeScript. It consumed the DevOps API to gather all relevant information about the team's current iteration, format as HTML email and send to a list of stakeholders. | ||
|
||
The main goal is to schedule this application to execute daily in a server so every business day the report about the iteration status will be sended to a list of stakeholders, freeing the dev team time to focus on what really matters. | ||
|
||
## 1. Project structure 🏠 | ||
|
||
This project uses clean code approach with repository pattern. The structure is the following: | ||
|
||
``` | ||
|-\assets | ||
|----\images | ||
|----\templates | ||
|-\src | ||
|----\domain | ||
|--------\model | ||
|--------\use-case | ||
|----\infra | ||
|--------\repository | ||
|----\use-case | ||
``` | ||
|
||
### 1.1 assets directory | ||
Contains all images and [Eta](https://github.com/eta-dev/eta) templates in respective folders. | ||
|
||
The project templates are in brazilian portuguese but feel free to adapt the templates according your needs. | ||
|
||
### 1.2 src directory | ||
Contains all source files separated by responsibilities like `domain`, `infra` and `use-case` | ||
|
||
1. `domain`: contains all interfaces used across the application | ||
2. `infra`: contains all data repositories at this point | ||
3. `use-case`: contains all business logic like building the e-mail HTML, fetching the current iteration data and sending e-mail | ||
|
||
## 2. Environment Configuration 🔧 | ||
|
||
A example of a `.env` should be: | ||
|
||
``` | ||
PAT="azureDevOpsPersonalAccessToken" | ||
PROJECT_NAME="Project" | ||
TEAM_NAME="Project Product Team" | ||
ORGANIZATION_NAME="ACME" | ||
DEVOPS_USER="a.devops.user.with.access@user.com" | ||
DEVOPS_PASSWORD="the.password" | ||
SMTP_USER="user@host.com" | ||
SMTP_PASSWORD="super.secret.password" | ||
SMTP_HOST="smtp.host.com" | ||
SMTP_PORT=587 | ||
EMAIL_RECIPIENTS="stackholer@acme.com,another.stackholder@acme.com" | ||
EMAIL_CARBON_COPY_RECIPIENTS="team.member@team.com,another.team.member@team.com" | ||
DEBUG=false | ||
``` | ||
|
||
Remember to set all SMTP info correctly so the application will not be able to send the report. | ||
|
||
If you want to debug behavior just change the key `DEBUG` to `true`. | ||
|
||
For convenience there is a the [.env.example](.env.example) already in this repo. | ||
|
||
All environment variables have self explanatory names but a note about `EMAIL_RECIPIENTS` and `EMAIL_CARBON_COPY_RECIPIENTS` is that both accept more than one email address, just add all of them separated by comma like in a CSV file. | ||
|
||
The `DEVOPS_USER` and `DEVOPS_PASSWORD` are used to log in at team's current sprint backlog page and take a screenshot. There is a API to get the burndown image but it only works for teams that use Remaining Work as their burndown measure. | ||
|
||
## 3. Run 🏃♂️ | ||
|
||
After setting the `.env` file just run the command `yarn` to install all dependency packages and after it finished run `yarn start` or for short `yarn && yarn start`. | ||
|
||
## 4. Notes ❗ | ||
1. At this version you will need to schedule this application. If you plan to send a daily report automatically because there's no automatic task scheduler control which maintains this app running and executing only in a specific time. | ||
2. If you don't want to schedule this application as a task, keep in mind that you will need to run every time that send a daily report is necessary. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<div style="overflow-x:auto;"> | ||
<h1><%= it.sprint.name %> (de <%= `${it.sprint.attributes.startDate.getDate() + 1}/${it.sprint.attributes.startDate.getMonth() + 1}` %> até <%= `${it.sprint.attributes.finishDate.getDate() + 1}/${it.sprint.attributes.finishDate.getMonth() + 1}` %>)</h1> | ||
<table id="backlog"> | ||
<thead> | ||
<tr> | ||
<th scope="col">ID</th> | ||
<th scope="col">Tipo</th> | ||
<th scope="col">Descrição</th> | ||
<th scope="col">Pontos</th> | ||
<th scope="col">Estado</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% it.backlog.forEach(function(backlogItem) { %> | ||
<% | ||
var stateClass = ''; | ||
var stateText = ''; | ||
switch(backlogItem.state) { | ||
case 'New': | ||
stateClass = 'sprint-backlog'; | ||
stateText = 'Sprint Backlog'; | ||
break; | ||
case 'Dev': | ||
stateClass = 'development'; | ||
stateText = 'Em Desenvolvimento'; | ||
break; | ||
case 'Homologação': | ||
stateClass = 'homologation'; | ||
stateText = 'Em Homologação'; | ||
break; | ||
case 'Closed': | ||
stateClass = 'closed'; | ||
stateText = 'Finalizado'; | ||
break; | ||
} | ||
%> | ||
<tr> | ||
<td class="text-center"><%= backlogItem.id %></td> | ||
<td class="text-center"><%= backlogItem.type %></td> | ||
<td><a href="<%= backlogItem.url %>" target="_blank"><%= backlogItem.title %></a></td> | ||
<td class="text-center"><%= backlogItem.storyPoints || 'N/A' %></td> | ||
<td class="<%= stateClass %> text-center"><%= stateText %></td> | ||
</tr> | ||
<% }) %> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div> | ||
<h1>Saúde da sprint</h1> | ||
<img src="data:image/png;base64,<%= it.burndown %>" alt="Burndown <%= it.sprint.name %>" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!doctype html> | ||
<html lang="pt"> | ||
|
||
<head> | ||
<title>Report Diário</title> | ||
<meta content="text/html; charset=UTF-8" http-equiv="content-type"> | ||
<style> | ||
html, body { | ||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||
} | ||
|
||
.sprint-backlog { | ||
background-color: #512D6D; | ||
color: white; | ||
} | ||
|
||
.development { | ||
background-color: #2055A6; | ||
color: white; | ||
} | ||
|
||
.homologation { | ||
background-color: #33B4C4; | ||
color: white; | ||
} | ||
|
||
.blocked { | ||
background-color: #F06400; | ||
color: #000 | ||
} | ||
|
||
.closed { | ||
background-color: #A8C700; | ||
color: #000 | ||
} | ||
|
||
.text-center { | ||
text-align: center; | ||
} | ||
|
||
#backlog { | ||
border-collapse: collapse; | ||
} | ||
|
||
#backlog td, #backlog th { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
} | ||
|
||
#backlog th { | ||
padding-top: 12px; | ||
padding-bottom: 12px; | ||
text-align: center; | ||
background-color: #1b82fc; | ||
color: white; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<%~ await includeFile('./header') %> | ||
<%~ await includeFile('./body', it) %> | ||
<%~ await includeFile('./footer') %> | ||
</body> | ||
|
||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.