Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(board): add boards #2

Merged
merged 35 commits into from
Sep 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
79b761a
feat(board): Add boards
WikiRik Nov 7, 2020
473984a
chore(permission): Change name of permission
WikiRik Nov 9, 2020
d9db153
chore(test): fix metrics test
WikiRik Nov 9, 2020
46f64f9
fix(migration): end_date should be optional
WikiRik Nov 9, 2020
75b4589
chore(test): fix non-existant test
WikiRik Nov 22, 2020
96f5e28
fix(router): add bodies before body_id
WikiRik Nov 22, 2020
c4ee3b0
chore(deps): bump prom-client from 12.0.0 to 13.1.0
dependabot[bot] Jan 29, 2021
a6a66c0
chore(prom-client): add await
WikiRik Feb 7, 2021
62ab530
fix(docker): fix the building of the container
LeonVreling Feb 8, 2021
1ff36c0
fix(board): fix return all boards for body
LeonVreling Feb 8, 2021
ff58dd1
feat(board): add endpoint to get current board of body
LeonVreling Feb 11, 2021
ee9e12d
feat(tests): add tests board listing
LeonVreling Feb 11, 2021
bd54824
chore(style): fix lint
LeonVreling Feb 11, 2021
31abdf1
chore(lint): re-enable imports
LeonVreling Feb 11, 2021
ce2ab4b
fix(test): add headers to tests
LeonVreling Feb 11, 2021
7ec6d4f
fix: query correct endpoints
LeonVreling Feb 16, 2021
9680179
feat(board): add tests board creation
LeonVreling Mar 16, 2021
5080e29
fix(mock): add missed export body mock
LeonVreling Mar 16, 2021
dbbfc0e
fix(board): fix board creation tests
LeonVreling Mar 20, 2021
de966ca
chore(board): remove unused if-case
LeonVreling Mar 20, 2021
2c5b377
chore(board): add tests mailer
LeonVreling Mar 20, 2021
517068d
feat(board): add more tests
LeonVreling Mar 20, 2021
3aeb99d
chore(board): fix tests (finally)
LeonVreling Mar 20, 2021
67a5243
chore(board): fix lint, remove unused imports
LeonVreling Mar 20, 2021
f543426
feat(board): add mail netcom on new board
LeonVreling Mar 21, 2021
645d19b
test(board): fix tests mailer
LeonVreling Mar 21, 2021
b506b4b
style(board): fix lint
LeonVreling Mar 21, 2021
aea78fe
style(board): fix lint
LeonVreling Mar 21, 2021
2552012
feat(board): add name board
LeonVreling Apr 24, 2021
c66c8de
fix(ci): updated ci and deps
WikiRik Jun 2, 2021
35cf242
style(yaml): fix yamllint
WikiRik Jun 2, 2021
0ee36c1
fix(deps): bring together with other modules
WikiRik Nov 18, 2021
36fd542
chore(docker-compose): revert docker-compose version
WikiRik Nov 18, 2021
04a3944
chore(deps): updated deps
WikiRik Dec 1, 2021
b231c92
fix: add view:board permission
WikiRik Sep 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 182 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,237 @@
orbs:
slack: circleci/[email protected]
codecov: codecov/[email protected]
docker: circleci/[email protected]
node: circleci/[email protected]
shellcheck: circleci/[email protected]
slack: circleci/[email protected]
version: 2.1
jobs:
test:
machine:
image: ubuntu-1604:201903-01
docker:
- image: cimg/node:16.13.0
- image: circleci/postgres:10.18
environment:
POSTGRES_PASSWORD: config.test.postgres.password
parallelism: 4
steps:
- checkout
- run: docker run --name postgres -p 5432:5432 -d postgres:10.6
- run:
name: Install Node
command: |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV
which node && node -v
- run: npm install
- node/install-packages
- run: mkdir -p ~/reports/jest
- run:
name: Run tests
command: JEST_JUNIT_OUTPUT_DIR=$HOME/reports/jest npm test -- --reporters=default --reporters=jest-junit
- run: ./node_modules/.bin/codecov
command: |
TEST=$(circleci tests glob test/**/*.js | circleci tests split --split-by=timings)
JEST_JUNIT_OUTPUT_DIR=$HOME/reports/jest npm run test:ci $TEST -- --reporters=default --reporters=jest-junit
- codecov/upload
- store_test_results:
path: ~/reports
- store_artifacts:
path: ~/reports
build:
machine:
image: ubuntu-1604:201903-01
docker:
- image: cimg/base:2021.10
steps:
- checkout
- setup_remote_docker:
version: 20.10.7
- run: docker-compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml build --no-cache network
eslint:
machine:
image: ubuntu-1604:201903-01
docker:
- image: cimg/node:16.13.0
steps:
- checkout
- run:
name: Install Node
command: |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV
which node && node -v
- run: npm install
- node/install-packages
- run: mkdir -p ~/reports
- run: npm run lint -- --format junit --output-file ~/reports/eslint.xml
- store_test_results:
path: ~/reports
- store_artifacts:
path: ~/reports
yamllint:
machine:
image: ubuntu-1604:201903-01
docker:
- image: cimg/python:3.10.0
steps:
- checkout
- run: pip install yamllint
- run: yamllint -d .yamllint.yml .
shellcheck:
docker:
- image: cimg/base:2021.10
steps:
- checkout
- shellcheck/install
- shellcheck/check
audit:
docker:
- image: cimg/node:16.13.0
steps:
- checkout
- run: npm audit --production
- slack/notify:
event: fail
custom: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: The audit check for `$CIRCLE_PROJECT_REPONAME` has failed."
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME"
},
{
"type": "mrkdwn",
"text": "*Job Number*\n$CIRCLE_BUILD_NUM"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Visit Job"
},
"url": "${CIRCLE_BUILD_URL}"
}
]
}
]
}
docker-build-and-push:
machine:
image: ubuntu-1604:201903-01
docker:
- image: cimg/node:16.13.0
steps:
- checkout
- run:
name: Install Node
command: |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
echo 'export PATH=/usr/bin:$PATH' >> $BASH_ENV
which node && node -v
- run: npm install
- setup_remote_docker:
version: 20.10.7
- node/install-packages
- run: npx semantic-release
- run: docker build --tag aegee/network:$(node -p "require('./package.json').version") --tag aegee/network:latest -f ./docker/network/Dockerfile .
- run: echo export PACKAGE_VERSION=$(node -p "require('./package.json').version") >> $BASH_ENV
- run: docker build --tag aegee/network:$PACKAGE_VERSION --tag aegee/network:latest -f docker/network/Dockerfile .
- run: docker login --username $DOCKER_LOGIN --password $DOCKER_PASSWORD
- run: docker push aegee/network:$(node -p "require('./package.json').version")
- run: docker push aegee/network:$PACKAGE_VERSION
- run: docker push aegee/network:latest
- slack/status:
success_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` with tags \`$(node -p "require('./package.json').version")\` and \`latest\` has been pushed to Dockerhub.
failure_message: The Docker image for \`$CIRCLE_PROJECT_REPONAME\` build and push has failed.
- slack/notify:
event: pass
custom: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":white_check_mark: The Docker image for `$CIRCLE_PROJECT_REPONAME` with tags `$PACKAGE_VERSION` and `latest` has been pushed to Dockerhub."
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME"
},
{
"type": "mrkdwn",
"text": "*Job Number*\n$CIRCLE_BUILD_NUM"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Visit Job"
},
"url": "${CIRCLE_BUILD_URL}"
}
]
}
]
}
- slack/notify:
event: fail
custom: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":octagonal_sign: The Docker image for `$CIRCLE_PROJECT_REPONAME` build and push has failed."
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Project*\n$CIRCLE_PROJECT_REPONAME"
},
{
"type": "mrkdwn",
"text": "*Job Number*\n$CIRCLE_BUILD_NUM"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Visit Job"
},
"url": "${CIRCLE_BUILD_URL}"
}
]
}
]
}

workflows:
version: 2
test:
jobs:
- test
eslint:
linters:
jobs:
- eslint
yamllint:
jobs:
- yamllint
- shellcheck
- docker/hadolint:
dockerfiles: $(find . -name '*Dockerfile*')
build:
jobs:
- build:
filters:
branches:
ignore: main
test:
jobs:
- test
docker-build-and-push:
jobs:
- docker-build-and-push:
filters:
branches:
only: main
audit:
triggers:
- schedule:
cron: "0 0 * * 5"
filters:
branches:
only: main
jobs:
- audit
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node": true,
"jest": true
},
"extends": "airbnb",
"extends": "airbnb-base",
"rules": {
"no-underscore-dangle": "off",
"no-param-reassign": ["error", { "props": false }],
Expand Down
2 changes: 2 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3025
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
1 change: 0 additions & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ rules:
document-start: disable
line-length: disable
truthy: disable
comments-indentation: disable
6 changes: 5 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional']
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0],
'footer-max-line-length': [0]
}
};
7 changes: 5 additions & 2 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const deepAssign = require('deep-assign');
const lodash = require('lodash');

const config = {
default: {
Expand All @@ -22,6 +22,9 @@ const config = {
url: 'http://mailer',
port: 4000
},
new_board_notifications: [
'[email protected]'
],
logger: {
silent: false,
level: process.env.LOGLEVEL || 'info'
Expand Down Expand Up @@ -65,7 +68,7 @@ let appConfig = config.default || {};

// If we have the environment config, overwrite the config's fields with its fields
if (config[env]) {
appConfig = deepAssign(appConfig, config[env]);
appConfig = lodash.merge(appConfig, config[env]);
}

module.exports = appConfig;
4 changes: 3 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ version: "3.4"
### NETWORK #######################################
services:
postgres-network:
image: postgres:10
restart: always
image: postgres:10.18
volumes:
- postgres-network:/var/lib/postgresql/data
expose:
Expand All @@ -12,6 +13,7 @@ services:
POSTGRES_PASSWORD: "${PW_POSTGRES}"

network:
restart: always
image: aegee/network:latest
volumes:
- network-media:/usr/app/media
Expand Down
Loading