Merge remote-tracking branch 'projectmanagement/master'

This commit is contained in:
2023-03-14 17:19:07 +01:00
43 changed files with 9516 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -0,0 +1,2 @@
resources
openapi

View File

@@ -0,0 +1,3 @@
{
"extends": "@openstapps"
}

View File

@@ -0,0 +1,91 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
#DynamoDB Local files
.dynamodb/
########## end of https://github.com/github/gitignore/blob/master/Node.gitignore
# ignore ide files
.idea
.vscode
# ignore lib
lib
# ignore docs
docs

View File

@@ -0,0 +1,201 @@
image: registry.gitlab.com/openstapps/projectmanagement/node
before_script:
- npm ci
default:
tags:
- performance
stages:
- build
- test
- maintenance
- audit
- publish
- deploy
npm build:
stage: build
script:
- npm run build
artifacts:
paths:
- lib
npm test:
script:
- npm run test
stage: test
docker image builder:
image: registry.gitlab.com/openstapps/projectmanagement/builder
stage: build
only:
variables:
- $BUILD_IMAGES == "true"
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/openstapps/projectmanagement/builder -f images/builder/Dockerfile .
- docker push registry.gitlab.com/openstapps/projectmanagement/builder
tags:
- secrecy
docker image node:
image: registry.gitlab.com/openstapps/projectmanagement/builder
stage: build
only:
variables:
- $BUILD_IMAGES == "true"
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com/openstapps/projectmanagement/
- docker build -t registry.gitlab.com/openstapps/projectmanagement/node -f images/node/Dockerfile images/node
- docker push registry.gitlab.com/openstapps/projectmanagement/node
tags:
- secrecy
docker image cypress:
image: registry.gitlab.com/openstapps/projectmanagement/builder
stage: build
only:
variables:
- $BUILD_IMAGES == "true"
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- export CHROME_VERSION=$(curl -fsSL https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions | jq -r '.versions[0].version')
- export FIREFOX_VERSION=$(curl -fsSL https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com/openstapps/projectmanagement/
- docker build --build-arg CHROME_VERSION=$CHROME_VERSION --build-arg FIREFOX_VERSION=$FIREFOX_VERSION -t registry.gitlab.com/openstapps/projectmanagement/cypress -f images/cypress/Dockerfile images/cypress
- docker push registry.gitlab.com/openstapps/projectmanagement/cypress
tags:
- secrecy
npm audit:
allow_failure: true
except:
- schedules
script:
- npm audit
stage: audit
scheduled npm audit:
only:
- schedules
except:
variables:
- $MAINTENANCE_MODE
- $RENOVATE
script:
- npm audit --production
stage: audit
tidy:
script:
- node lib/cli tidy
stage: maintenance
only:
variables:
- $MAINTENANCE_MODE == "tidy"
tags:
- secrecy
remind:
script:
- node lib/cli remind
stage: maintenance
only:
variables:
- $MAINTENANCE_MODE == "remind"
tags:
- secrecy
unlabel:
script:
- node lib/cli tidy
- node lib/cli unlabel
stage: maintenance
only:
variables:
- $MAINTENANCE_MODE == "unlabel"
tags:
- secrecy
pages:
stage: deploy
script:
- npm run documentation
- mv docs public
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
artifacts:
paths:
- public
npm package:
dependencies:
- npm build
tags:
- secrecy
stage: publish
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
- npm publish
only:
- /^v[0-9]+.[0-9]+.[0-9]+$/
artifacts:
paths:
- lib
renovate:
image: renovate/renovate:slim
services:
- docker:dind
cache:
key: ${CI_COMMIT_REF_SLUG}-renovate
paths:
- $CI_PROJECT_DIR/renovate
resource_group: production
stage: maintenance
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_VERIFY: 1
DOCKER_TLS_CERTDIR: /certs
DOCKER_CERT_PATH: /certs/client
RENOVATE_EXTENDS: "gitlab>openstapps/projectmanagement"
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_PLATFORM: gitlab
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_REPOSITORY_CACHE: 'true'
RENOVATE_REQUIRE_CONFIG: 'ignored'
RENOVATE_ONBOARDING: 'false'
RENOVATE_IGNORE_PR_AUTHOR: 'true'
RENOVATE_LOG_FILE: renovate-log.ndjson
RENOVATE_LOG_FILE_LEVEL: info
LOG_LEVEL: warn
only:
variables:
- $RENOVATE == "true"
tags:
- secrecy
timeout: 2h
artifacts:
when: always
expire_in: 1d
paths:
- "$RENOVATE_LOG_FILE"
before_script: []
script:
- renovate $RENOVATE_EXTRA_FLAGS

View File

@@ -0,0 +1,38 @@
## Summary
(Summarize the bug encountered concisely)
## Steps to reproduce
(How one can reproduce the issue - this is very important)
## Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
## Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
/label ~meeting

View File

@@ -0,0 +1,16 @@
## Description
(Describe the feature that you're requesting concisely)
## Explanation
(Explain why the feature is necessary)
## Dependencies, issues to be resolved beforehand
(List issues or dependencies that need to be resolved before this feature can be implemented)
/label ~meeting

View File

@@ -0,0 +1,12 @@
# Ignore all files/folders by default
# See https://stackoverflow.com/a/29932318
/*
# Except these files/folders
!lib
lib/tsconfig.tsbuildinfo
!LICENSE
!package.json
!package-lock.json
!README.md
!src
!templates

View File

@@ -0,0 +1,314 @@
# [0.25.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.24.0...v0.25.0) (2023-01-17)
### Bug Fixes
* broken cypress build ([a37d3a9](https://gitlab.com/openstapps/projectmanagement/commit/a37d3a9ec4c8303bef7f7f29fdb8f7401ef7b02a))
* renovate job timeout ([116c880](https://gitlab.com/openstapps/projectmanagement/commit/116c8809e4f7d524361275e910fdc582a9baf78a))
# [0.24.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.23.1...v0.24.0) (2022-10-10)
## [0.23.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.23.0...v0.23.1) (2022-07-05)
### Bug Fixes
* documentation not generating ([ac226d1](https://gitlab.com/openstapps/projectmanagement/commit/ac226d178a41e24a57f5e24409255aee2cfabf8d))
# [0.23.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.22.0...v0.23.0) (2022-07-05)
# [0.22.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.21.0...v0.22.0) (2021-12-14)
# [0.21.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.20.1...v0.21.0) (2021-12-14)
### Bug Fixes
* exclude npm audit from maintenance runs ([42e6812](https://gitlab.com/openstapps/projectmanagement/commit/42e68120b7215b6fe0f929955d99907103b7bfed))
* link to old gitlab server ([aa9991a](https://gitlab.com/openstapps/projectmanagement/commit/aa9991ad708dd80b873b738a304c94f6f21dd4ba)), closes [#27](https://gitlab.com/openstapps/projectmanagement/issues/27)
### Features
* make slack notification optional ([84921ad](https://gitlab.com/openstapps/projectmanagement/commit/84921ad5ce90c24ce53197235e8f8a8aff0f4aba))
## [0.20.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.20.0...v0.20.1) (2020-07-27)
### Bug Fixes
* ignore archived projects in milestone tidy ([cd768a9](https://gitlab.com/openstapps/projectmanagement/commit/cd768a9dcdb8edc62f8277a45b054e261311e404))
* remove invalid project name element ([e4c065d](https://gitlab.com/openstapps/projectmanagement/commit/e4c065d5058512ecab1b7fb173e34d950abb123f))
### Features
* add merge request assignment ([65d05bf](https://gitlab.com/openstapps/projectmanagement/commit/65d05bfe692c7589ae4138439724ba7c0c73bec5))
# [0.20.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.19.0...v0.20.0) (2020-05-06)
### Features
* change builder base image to docker/compose ([5ea40b2](https://gitlab.com/openstapps/projectmanagement/commit/5ea40b2ece8cb2ae764096121492dd9703963f1d))
# [0.19.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.18.0...v0.19.0) (2020-01-08)
# [0.18.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.17.1...v0.18.0) (2019-11-25)
## [0.17.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.17.0...v0.17.1) (2019-11-19)
### Features
* add documentation for automatic publishing ([ab45e35](https://gitlab.com/openstapps/projectmanagement/commit/ab45e35117ef0cca3f42c557e100d4e57a2571df)), closes [#23](https://gitlab.com/openstapps/projectmanagement/issues/23)
# [0.17.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.16.1...v0.17.0) (2019-11-13)
### Features
* update to new meeting date ([98c73b5](https://gitlab.com/openstapps/projectmanagement/commit/98c73b575846fb342c4ffb6a2cf09152a3205f95))
## [0.16.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.16.0...v0.16.1) (2019-08-20)
### Bug Fixes
* add colors to cli log output ([7d271a7](https://gitlab.com/openstapps/projectmanagement/commit/7d271a73648d2367e57a3b6c6bb5725d106dced6))
# [0.16.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.15.0...v0.16.0) (2019-08-20)
### Features
* only unlabel closed issues before last meeting ([d7b68ae](https://gitlab.com/openstapps/projectmanagement/commit/d7b68ae45c8321f0a1d9cba998b604507445f9fb))
# [0.15.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.14.1...v0.15.0) (2019-07-23)
### Features
* add function and task to get version of used dependency ([067a201](https://gitlab.com/openstapps/projectmanagement/commit/067a2011c03b1e3e9d164844d594e4f332982f12)), closes [#20](https://gitlab.com/openstapps/projectmanagement/issues/20)
## [0.14.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.14.0...v0.14.1) (2019-06-05)
# [0.14.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.13.0...v0.14.0) (2019-06-04)
### Bug Fixes
* fix regression with protected tags ([65a7233](https://gitlab.com/openstapps/projectmanagement/commit/65a723390572f48601e52dac975c9e2b4a0f06c4))
### Features
* add max depth for reminders ([3641ec4](https://gitlab.com/openstapps/projectmanagement/commit/3641ec4d00890f81b24301b61d689cd113e33997))
# [0.13.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.12.1...v0.13.0) (2019-06-03)
### Features
* add curl to Node.js image ([2ec80fb](https://gitlab.com/openstapps/projectmanagement/commit/2ec80fbb2f1256530e61a389a8444163c7aef8bd)), closes [#18](https://gitlab.com/openstapps/projectmanagement/issues/18)
## [0.12.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.12.0...v0.12.1) (2019-05-27)
# [0.12.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.11.0...v0.12.0) (2019-05-27)
### Bug Fixes
* use user 'node' in Node.js image ([0c8aa72](https://gitlab.com/openstapps/projectmanagement/commit/0c8aa7257add9fd5997105f18b69211152fd8971)), closes [#17](https://gitlab.com/openstapps/projectmanagement/issues/17)
### Features
* add git to node image ([c0058f9](https://gitlab.com/openstapps/projectmanagement/commit/c0058f9c2918bae3e5fce58f11802174ea08084c)), closes [#16](https://gitlab.com/openstapps/projectmanagement/issues/16)
* notify merge request assignee instead of author ([d60625c](https://gitlab.com/openstapps/projectmanagement/commit/d60625c461c6fe54b7c60091050a31f7f77a958e))
# [0.11.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.10.0...v0.11.0) (2019-04-30)
### Features
* tidy sub groups ([de05b52](https://gitlab.com/openstapps/projectmanagement/commit/de05b52f24985a882dbacdf82cc1a7c3c4efbe88))
# [0.10.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.9.0...v0.10.0) (2019-04-17)
### Features
* add timestamp to reports ([ad99e45](https://gitlab.com/openstapps/projectmanagement/commit/ad99e45ee3de59de4b5fcca312cb077d90d73335))
# [0.9.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.8.1...v0.9.0) (2019-04-09)
### Features
* add check for protected tags to tidy task ([feb0c3b](https://gitlab.com/openstapps/projectmanagement/commit/feb0c3ba019b1fdfdc5912db86b20d9cc2dd650f)), closes [#14](https://gitlab.com/openstapps/projectmanagement/issues/14)
## [0.8.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.8.0...v0.8.1) (2019-03-20)
# [0.8.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.7.0...v0.8.0) (2019-03-20)
### Features
* use mustache instead of tangular ([95f7521](https://gitlab.com/openstapps/projectmanagement/commit/95f7521dbddc13a6acb5835ae05dd5535cce067f))
# [0.7.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.6.0...v0.7.0) (2019-03-20)
# [0.6.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.5.0...v0.6.0) (2019-02-25)
### Features
* adjust reminder for unfixed merge requests ([e02939c](https://gitlab.com/openstapps/projectmanagement/commit/e02939c470ff9a63fb33c9754e06ea4dfbbd9b15))
# [0.5.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.4.1...v0.5.0) (2019-02-05)
### Features
* add new task to remind about open merge requests ([201ec09](https://gitlab.com/openstapps/projectmanagement/commit/201ec093b7ab676d5d7a84972c5d9e64664af7e0))
## [0.4.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.4.0...v0.4.1) (2019-01-30)
# [0.4.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.3.0...v0.4.0) (2019-01-30)
### Features
* add slack reminder for open merge requests ([47e9775](https://gitlab.com/openstapps/projectmanagement/commit/47e977583bc036d48194d1e6bc9e6214dbbe6062))
# [0.3.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.2.2...v0.3.0) (2019-01-28)
### Features
* include sub groups in report generation ([040c666](https://gitlab.com/openstapps/projectmanagement/commit/040c666e747df35b773be1a0e30b7ba99f3b6598))
## [0.2.2](https://gitlab.com/openstapps/projectmanagement/compare/v0.2.1...v0.2.2) (2019-01-23)
### Bug Fixes
* correctly determine project for issue ([8f06fc3](https://gitlab.com/openstapps/projectmanagement/commit/8f06fc35347f06e8409e4190079323af91fc0a37))
## [0.2.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.2.0...v0.2.1) (2019-01-17)
### Bug Fixes
* correctly add shebang line to cli ([f2933ef](https://gitlab.com/openstapps/projectmanagement/commit/f2933ef9e23e6fa92086800d791c9e4c6685fd4b))
# [0.2.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.1.1...v0.2.0) (2019-01-17)
### Bug Fixes
* correct link for projects ([a95ec14](https://gitlab.com/openstapps/projectmanagement/commit/a95ec14be8e169ee1e9f84e3ef98a9712babd302))
* do not add issues to report from backlog ([e902d70](https://gitlab.com/openstapps/projectmanagement/commit/e902d705bf66e07f70a9c34f9f13160c5db5982f))
* unlabel issues with label meeting only ([41a349e](https://gitlab.com/openstapps/projectmanagement/commit/41a349ead50db256916f5506829e587d1ecb4a43))
## [0.1.1](https://gitlab.com/openstapps/projectmanagement/compare/v0.1.0...v0.1.1) (2019-01-07)
### Bug Fixes
* remove failing deletion of labels ([ac8f2e1](https://gitlab.com/openstapps/projectmanagement/commit/ac8f2e10f965ef0e4950d8f294b6c34a26f4bad0))
# [0.1.0](https://gitlab.com/openstapps/projectmanagement/compare/v0.0.2...v0.1.0) (2018-12-13)
## [0.0.2](https://gitlab.com/openstapps/projectmanagement/compare/v0.0.1...v0.0.2) (2018-12-03)
### Features
* add issue template for features ([8ae1a51](https://gitlab.com/openstapps/projectmanagement/commit/8ae1a5166962c5d0b41b869c6021ddc456407022))
* add nyc configuration ([883ab9b](https://gitlab.com/openstapps/projectmanagement/commit/883ab9bfa55def9a0a8dd4ee5427c1eb9ad2960b))
## [0.0.1](https://gitlab.com/openstapps/projectmanagement/compare/19fd0f6e4cb8b44152333242aa17db84b2bd038a...v0.0.1) (2018-11-29)
### Features
* add projectmanagement and pack ([19fd0f6](https://gitlab.com/openstapps/projectmanagement/commit/19fd0f6e4cb8b44152333242aa17db84b2bd038a))

View File

@@ -0,0 +1,17 @@
# How to contribute
To contribute effectively to this or other Open StApps projects you should read the documentation in this repository first.
* What's the scope of one [project](../project-docs/workflow/PROJECT.md)?
* How to create [issues](../project-docs/workflow/ISSUES.md) in projects.
* How to [set up](../project-docs/SETUP.md) your machine?
* How to contribute code?
* What's the [branching model](../project-docsworkflow/BRANCHING.md)?
* How to write [code](../project-docs/workflow/CODING.md)?
* How to create [merge requests](../project-docs/workflow/MERGING.md)?
* How to write [documentation](../project-docs/workflow/DOCUMENTATION.md)?
* How to [version](../project-docs/workflow/VERSIONING.md) the code?
## Further resources
* [Docker cheat sheet](../project-docs/DOCKER_CHEAT_SHEET.md)

View File

@@ -0,0 +1,200 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/ licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,54 @@
# @openstapps/projectmanagement
[![pipeline status](https://img.shields.io/gitlab/pipeline/openstapps/projectmanagement.svg?style=flat-square)](https://gitlab.com/openstapps/projectmanagement/commits/master)
[![npm](https://img.shields.io/npm/v/@openstapps/projectmanagement.svg?style=flat-square)](https://npmjs.com/package/@openstapps/projectmanagement)
[![license)](https://img.shields.io/npm/l/@openstapps/projectmanagement.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![documentation](https://img.shields.io/badge/documentation-online-blue.svg?style=flat-square)](https://openstapps.gitlab.io/projectmanagement)
This repository contains documentation, project resources and cli tools to manage the `@openstapps` projects.
## Meetings
We have developer meetings via video conference on at least every first and third wednesday of the month.
An agenda is generated with the project management tool that contains all issues that have the label `meeting`.
## Integrating new schools
### Subgroup in GitLab
Every school gets their own subgroup on GitLab inside the group `@openstapps`.
The technical name is the license plate of the school. This can be found in the [list of license plates](project-docs/SCHOOL_IDENTIFIERS.md).
The official name of the school is used as the group's name and a matching logo is picked to act as the group's logo - this should be a square one because of the way that GitLab handles/shows logos.
#### Permissions on the group
Every school should have one maintainer on the main group. This should be someone that is involved in the development.
Inside the subgroup every school can decide on its own how to handle permissions.
### Adjusting common projects
#### `gitlab-ci.yml` in `@openstapps/backend`
Every school has their own Docker image for the backend because every school needs other plugins and configuration. This is easily accomplished with a dedicated entry in the [`.gitlab-ci-yml`](https://gitlab.com/openstapps/backend/-/blob/master/.gitlab-ci.yml).
#### Add namespace for UUID generation
To be able to generate UUIDs for things that need to be indexed/added to the backend every schools needs a namespace in the [`@openstapps/api`](https://gitlab.com/openstapps/api). This namespace can be any random, valid UUIDv4.
#### Add subgroup's id to the scripts configuration
To use the project management tool for the new subgroup, the id of that group needs to be added to the configuration of the tool.
The groups id can be found in the settings of the group on GitLab.
## Project management tool
This is a small cli tool that helps to maintain the project(s).
```shell
openstapps-projectmanagement --help
```

View File

@@ -0,0 +1,22 @@
FROM docker/compose
ARG NODE_VERSION="14"
RUN apk update && apk add nodejs npm git jq curl
RUN export DOWNLOAD_VERSION=$(curl -fsSL --compressed https://unofficial-builds.nodejs.org/download/release/index.json | \
jq --raw-output ".[]|select(.version | startswith(\"v$NODE_VERSION\"))|.version" | head -1) && \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/$DOWNLOAD_VERSION/node-$DOWNLOAD_VERSION-linux-x64-musl.tar.xz" && \
tar -xJf "node-$DOWNLOAD_VERSION-linux-x64-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && \
ln -sf /usr/local/bin/node /usr/local/bin/nodejs
ADD . /opt/openstapps/projectmanagement
WORKDIR /opt/openstapps/projectmanagement
RUN npm ci && \
npm run build && \
chmod +x /opt/openstapps/projectmanagement/lib/cli.js && \
ln -s /opt/openstapps/projectmanagement/lib/cli.js /usr/bin/openstapps-projectmanagement
CMD []

View File

@@ -0,0 +1,101 @@
# WARNING: this file was autogenerated by generate-browser-image.js
# using
# yarn add:browser -- 14.19.0 --chrome=100.0.4896.88 --firefox=99.0.1 --edge
#
# build args added afterwards
#
FROM cypress/base:14.21.1
ARG CHROME_VERSION="unknown"
ARG FIREFOX_VERSION="unknown"
USER root
RUN node --version
# Install dependencies
RUN apt-get update && \
apt-get install -y \
fonts-liberation \
git \
libcurl4 \
libcurl3-gnutls \
libcurl3-nss \
xdg-utils \
wget \
curl \
# firefox dependencies
bzip2 \
# add codecs needed for video playback in firefox
# https://github.com/cypress-io/cypress-docker-images/issues/150
mplayer \
# edge dependencies
gnupg \
dirmngr \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# install libappindicator3-1 - not included with Debian 11
RUN wget --no-verbose -O /usr/src/libappindicator3-1_0.4.92-7_amd64.deb "http://ftp.us.debian.org/debian/pool/main/liba/libappindicator/libappindicator3-1_0.4.92-7_amd64.deb" && \
dpkg -i /usr/src/libappindicator3-1_0.4.92-7_amd64.deb ; \
apt update && \
apt --fix-broken install -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
rm -f /usr/src/libappindicator3-1_0.4.92-7_amd64.deb
# install Chrome browser
RUN wget --no-verbose -O /usr/src/google-chrome-stable_current_amd64.deb "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" && \
dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \
apt update && \
apt --fix-broken install -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
rm -f /usr/src/google-chrome-stable_current_amd64.deb
# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
# install Firefox browser
RUN wget --no-verbose -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2" && \
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
rm /tmp/firefox.tar.bz2 && \
ln -fs /opt/firefox/firefox /usr/bin/firefox
RUN echo "Downloading Latest Edge version..."
## Setup Edge
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
RUN install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
RUN rm microsoft.gpg
## Install Edge
RUN apt-get update && \
apt-get install -y microsoft-edge-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Add a link to the browser that allows Cypress to find it
RUN ln -s /usr/bin/microsoft-edge /usr/bin/edge
# versions of local tools
RUN echo " node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v) \n" \
"debian version: $(cat /etc/debian_version) \n" \
"Chrome version: $(google-chrome --version) \n" \
"Firefox version: $(firefox --version) \n" \
"Edge version: $(edge --version) \n" \
"git version: $(git --version) \n" \
"whoami: $(whoami) \n"
# a few environment variables to make NPM installs easier
# good colors for most applications
ENV TERM=xterm
# avoid million NPM install messages
ENV npm_config_loglevel=warn
# allow installing when the main user is root
ENV npm_config_unsafe_perm=true

View File

@@ -0,0 +1,11 @@
FROM node:14-alpine
RUN apk update && apk add git curl jq && mkdir -p /opt
COPY --chown=root:root wait-for.sh /opt/wait-for
RUN chmod +x /opt/wait-for && ln -s /opt/wait-for /usr/local/bin/wait-for
USER node
CMD []

View File

@@ -0,0 +1,184 @@
#!/bin/sh
# The MIT License (MIT)
#
# Copyright (c) 2017 Eficode Oy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
set -- "$@" -- "$TIMEOUT" "$QUIET" "$PROTOCOL" "$HOST" "$PORT" "$result"
TIMEOUT=15
QUIET=0
# The protocol to make the request with, either "tcp" or "http"
PROTOCOL="tcp"
echoerr() {
if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
}
usage() {
exitcode="$1"
cat << USAGE >&2
Usage:
$0 host:port|url [-t timeout] [-- command args]
-q | --quiet Do not output any status messages
-t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout
-- COMMAND ARGS Execute command with args after the test finishes
USAGE
exit "$exitcode"
}
wait_for() {
case "$PROTOCOL" in
tcp)
if ! command -v nc >/dev/null; then
echoerr 'nc command is missing!'
exit 1
fi
;;
wget)
if ! command -v wget >/dev/null; then
echoerr 'wget command is missing!'
exit 1
fi
;;
esac
while :; do
case "$PROTOCOL" in
tcp)
nc -w 1 -z "$HOST" "$PORT" > /dev/null 2>&1
;;
http)
wget --timeout=1 -q "$HOST" -O /dev/null > /dev/null 2>&1
;;
*)
echoerr "Unknown protocol '$PROTOCOL'"
exit 1
;;
esac
result=$?
if [ $result -eq 0 ] ; then
if [ $# -gt 7 ] ; then
for result in $(seq $(($# - 7))); do
result=$1
shift
set -- "$@" "$result"
done
TIMEOUT=$2 QUIET=$3 PROTOCOL=$4 HOST=$5 PORT=$6 result=$7
shift 7
exec "$@"
fi
exit 0
fi
if [ "$TIMEOUT" -le 0 ]; then
break
fi
TIMEOUT=$((TIMEOUT - 1))
sleep 1
done
echo "Operation timed out" >&2
exit 1
}
while :; do
case "$1" in
http://*|https://*)
HOST="$1"
PROTOCOL="http"
shift 1
;;
*:* )
HOST=$(printf "%s\n" "$1"| cut -d : -f 1)
PORT=$(printf "%s\n" "$1"| cut -d : -f 2)
shift 1
;;
-q | --quiet)
QUIET=1
shift 1
;;
-q-*)
QUIET=0
echoerr "Unknown option: $1"
usage 1
;;
-q*)
QUIET=1
result=$1
shift 1
set -- -"${result#-q}" "$@"
;;
-t | --timeout)
TIMEOUT="$2"
shift 2
;;
-t*)
TIMEOUT="${1#-t}"
shift 1
;;
--timeout=*)
TIMEOUT="${1#*=}"
shift 1
;;
--)
shift
break
;;
--help)
usage 0
;;
-*)
QUIET=0
echoerr "Unknown option: $1"
usage 1
;;
*)
QUIET=0
echoerr "Unknown argument: $1"
usage 1
;;
esac
done
if ! [ "$TIMEOUT" -ge 0 ] 2>/dev/null; then
echoerr "Error: invalid timeout '$TIMEOUT'"
usage 3
fi
case "$PROTOCOL" in
tcp)
if [ "$HOST" = "" ] || [ "$PORT" = "" ]; then
echoerr "Error: you need to provide a host and port to test."
usage 2
fi
;;
http)
if [ "$HOST" = "" ]; then
echoerr "Error: you need to provide a host to test."
usage 2
fi
;;
esac
wait_for "$@"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,102 @@
{
"name": "@openstapps/projectmanagement",
"version": "0.25.0",
"description": "Main documentation and scripts for maintenance.",
"repository": {
"type": "git",
"url": "git@gitlab.com:openstapps/projectmanagement.git"
},
"scripts": {
"build": "npm run lint && npm run compile",
"check-configuration": "openstapps-configuration",
"compile": "rimraf lib && tsc && prepend lib/cli.js '#!/usr/bin/env node\n'",
"documentation": "typedoc --out docs --readme README.md --listInvalidSymbolLinks --entryPointStrategy expand src",
"prepublishOnly": "npm ci && npm run build && npm run test",
"preversion": "npm run prepublishOnly",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"push": "git push && git push origin \"v$npm_package_version\"",
"test": "nyc mocha --require ts-node/register 'test/**/*.spec.ts'",
"lint": "eslint --ext .ts src/"
},
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
"contributors": [
"Anselm Stordeur <anselmstordeur@gmail.com>",
"Jovan Krunić <jovan.krunic@gmail.com>",
"Michel Jonathan Schmitz",
"Rainer Killinger <mail-openstapps@killinger.co>",
"Thea Schöbl <dev@theaninova.de>"
],
"license": "GPL-3.0-only",
"dependencies": {
"@krlwlfrt/async-pool": "0.4.1",
"@openstapps/gitlab-api": "0.10.0",
"@openstapps/logger": "1.1.1",
"@slack/client": "5.0.2",
"@types/glob": "7.2.0",
"@types/mustache": "4.2.2",
"@types/node": "14.18.36",
"@types/tmp": "0.2.3",
"commander": "9.5.0",
"glob": "8.1.0",
"moment": "2.29.4",
"mustache": "4.2.0",
"tmp": "0.2.1"
},
"devDependencies": {
"@openstapps/configuration": "0.33.0",
"@openstapps/eslint-config": "1.1.0",
"@testdeck/mocha": "0.3.3",
"@types/chai": "4.3.4",
"@types/chai-as-promised": "7.1.5",
"@types/mocha": "10.0.1",
"@typescript-eslint/eslint-plugin": "5.39.0",
"@typescript-eslint/parser": "5.39.0",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"conventional-changelog-cli": "2.2.2",
"eslint": "8.32.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-jsdoc": "39.6.4",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "44.0.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"prepend-file-cli": "1.0.6",
"prettier": "2.8.3",
"rimraf": "3.0.2",
"ts-node": "10.9.1",
"tslint": "6.1.3",
"typedoc": "0.22.18",
"typescript": "4.4.4"
},
"main": "lib/common.js",
"typings": "lib/common.d.ts",
"bin": {
"openstapps-projectmanagement": "lib/cli.js"
},
"nyc": {
"all": true,
"branches": 95,
"check-coverage": true,
"exclude": [
"src/cli.ts"
],
"extension": [
".ts"
],
"functions": 95,
"include": [
"src/tasks/get-used-version.ts"
],
"lines": 95,
"per-file": true,
"reporter": [
"html",
"text-summary"
],
"require": [
"ts-node/register"
],
"statements": 95
}
}

View File

@@ -0,0 +1,47 @@
# Docker cheat sheet
## List running containers
```shell
docker ps
```
## List running containers of a `docker-compose.yml`
In the directory of the `docker-compose.yml`:
```shell
docker-compose ps
```
## Restart container
`$CONTAINERID` from `docker ps`.
```shell
docker restart $CONTAINERID
```
## Run program in container
`$PROGRAM` can be any program that is installed in the container `bash`, `sh`, `node`, `curl`...
```shell
docker exec -it $CONTAINERID $PROGRAM
```
## Tidy system
This removes unused images, networks, ... from your system.
```shell
docker system prune
```
Please consult the [Docker documentation](https://docs.docker.com/engine/reference/commandline/system_prune/) for more information.
## Further resources
* [An Exhaustive Guide to Writing Dockerfiles for Node.js Web Apps](https://blog.hasura.io/an-exhaustive-guide-to-writing-dockerfiles-for-node-js-web-apps-bbee6bd2f3c4)
* [Docker and Node.js Best Practices
](https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md)

View File

@@ -0,0 +1,766 @@
To identify schools we use their license plates.
| City | School | License- | plate |
| --- | --- | --- | --- |
| Aachen | KFH NRW | AC | KF |
| Aachen | Theolog. HS | AC | FK |
| Aachen | Fachhochschule | AC | FH |
| Aachen | MuHo | AC | HM |
| Aachen | Rheinisch-Westf. TH | AC | TH |
| Aachen-Jülich | FachHS | DN | FH |
| Aalen | Fachhochschule | AA | FH |
| Albstadt | HS Albst.-Sigma. | SIG | F2 |
| Alfter | Alanus HS | SU | AH |
| Altenholz | FH Verwaltung | RD | VF |
| Amberg FH | Abt. Weiden | AM | F2 |
| Amberg | FH Abt. Amberg | AM | FH |
| Ansbach | FH | AN | FH |
| Arnstadt | FH Kunst | IK | FH |
| Aschaffenburg | FH | AB | FH |
| Aschersleben | FH Polizei | ASL | VF |
| Augsburg | HS f. Musik | A | HM |
| Augsburg | Universität | A | U |
| Augsburg | Fachhochschule | A | FH |
| Bad Hersfeld | HS Unfallv. | HEF | FH |
| Bad Homburg | HS | HG | HS |
| Bad Honnef | Intern. FH | SU | IF |
| Bad Liebenzell | Int. HS | CW | IH |
| Bad Mergentheim | DualHS | TBB | DH |
| Bad Münstereifel | VerwFH | EU | VF |
| Bad Saarow | A. K. Akad. | LOS | PF |
| Bad Sooden-Allen. | DIPLFH | ESW | PF |
| Bamberg | Universität | BA | U |
| Bayreuth | HS f. Kirchenm. | BT | KH |
| Bayreuth | Universität | BT | U |
| Benediktbeuren | PhilTh. HS | GAP | KH |
| Benneckenstein | Verw. FH | WR | VF |
| Bergisch-Gladb. | Wirts. FH | PB | F2 |
| Berlin | Akkon HS (Pr. FH) | B | AH |
| Berlin | AMD | B | AM |
| Berlin | ASFH | B | FS |
| Berlin | bbw HS | B | AB |
| Berlin | BEST - Sabel FH | B | PF |
| Berlin | Beuth HS | B | TF |
| Berlin | Charite-Univ. Med. | B | MU |
| Berlin | DEKRA HS | B | DK |
| Berlin | Design Akademie | B | P2 |
| Berlin | EBC HS | B | BS |
| Berlin | EDU. CON HS | B | EH |
| Berlin | ESCP HS | B | HW |
| Berlin | ESMOD Kunst-HS | B | ES |
| Berlin | Euro. Sch. o. Mang. | B | EM |
| Berlin | Europ. College | B | EC |
| Berlin | Evang. HS | B | EF |
| Berlin | FH Bund / FB Ausw. | B | VF |
| Berlin | German Bus. Sch. | B | GB |
| Berlin | Hertie School | B | HS |
| Berlin | HS d. pop. Künste | B | PK |
| Berlin | HS f. Medien | B | MH |
| Berlin | HS f. Techn. u. W. | B | FT |
| Berlin | HS Gesdh. u. Sport | B | P3 |
| Berlin | HS Wirtsch. Recht | B | FB |
| Berlin | HS Wirtsch. T. K. | B | WT |
| Berlin | Humb. Uni Virch. K. | B | U2 |
| Berlin | Humboldt Uni | B | U |
| Berlin | HWR FB Verwaltung | B | V2 |
| Berlin | HWR FB Wirtschaft | B | FW |
| Berlin | IB Hochschule | B | P4 |
| Berlin | Internat. HS | B | IH |
| Berlin | kath. HS | B | KF |
| Berlin | Macromedia FH | B | MF |
| Berlin | Mediadesign HS | B | DH |
| Berlin | Psychoanal. Uni. | B | PU |
| Berlin | Psychol. HS | B | PH |
| Berlin | Quadriga HS | B | QH |
| Berlin | SRH-Hochschule | B | OT |
| Berlin | Steinbeis HS | B | FH |
| Berlin | Stenden Uni. | B | SU |
| Berlin | Techn. Kunst HS | B | TK |
| Berlin | Touro College | B | TC |
| Berlin | Uni d. Künste | B | HK |
| Berlin | Uni f. Weiterbld. | B | WB |
| Berlin | FH der DBP TELEKOM | B | FP |
| Berlin | FH VerwSozVers. | B | V3 |
| Berlin | Freie Universität | B | FU |
| Berlin | HS f. Schauspielk. | B | H3 |
| Berlin | HS f. Musik | B | HM |
| Berlin | Kirchliche HS | B | KH |
| Berlin | Kunsthochschule | B | H4 |
| Berlin | Tech. FH Lichtenb. | B | F3 |
| Berlin | Techn. FH | B | F5 |
| Berlin | Techn. FH Wedding | B | F2 |
| Berlin | Techn. Uni. | B | TU |
| Bernau | FH öff. Verw. BrBg. | BER | VF |
| Bernburg | HS Anhalt | BBG | FH |
| Bernburg | HS Landwirtsch. | BBG | HS |
| Bethel | Kirchliche HS | W | K2 |
| Bethel | Kirchl. HS (ev.) | BI | KH |
| Biberach a. d. Riss | FH | BC | FH |
| Bielefeld | FH d. Diakonie | BI | DU |
| Bielefeld | FH d. Mittels. | BI | FM |
| Bielefeld | FH Wirtsch. P. | PB | F4 |
| Bielefeld | Universität | BI | U |
| Bielefeld | FH | BI | FH |
| Bielefeld | FH Verw. | BI | VF |
| Bierbronnen | Priv. Wiss. HS | WM | HS |
| Bingen | FH | MZ | FH |
| Birkenfeld | FH Trier | TR | F2 |
| Bochum | EBZ Bus. School | BO | EB |
| Bochum | FH | BO | FH |
| Bochum | FH (alter StatS.) | BO | F1 |
| Bochum | FH Gesundheit | BO | FG |
| Bochum | Folkwang-HS | BO | HM |
| Bochum | TFH | BO | F3 |
| Bochum | Ev. FH Rhld-Westf-L | BO | KF |
| Bochum | Ruhruniversität | BO | U |
| Bonn | HS d. S-Finanzgrp. | BN | SG |
| Bonn | Priv. FH Berufstät. | BN | PF |
| Bonn | FH Bund Ausw. Angel. | BN | VF |
| Bonn | priv. FH Bibliothek. | BN | FH |
| Bonn | Rh. Friedr. Wilh.-Uni | BN | U |
| Bottrop | FH | BOT | FH |
| Brandenburg | Verw. FH | BRB | VF |
| Brandenburg | FH | BRB | FH |
| Braunschweig | FH | BS | FH |
| Braunschweig | HS Bi. Kün. | BS | HK |
| Braunschweig | TU Carolo-W. | BS | TU |
| Bremen | Apollon HS | HB | AH |
| Bremen | HIWL | HB | HI |
| Bremen | HS | HB | FH |
| Bremen | Jacobs University | HB | IU |
| Bremen | KunstHS | HB | HK |
| Bremen | Universität | HB | U |
| Bremen | VerwHS | HB | VF |
| Bremerhaven | HS | HB | H |
| Bruchsal | Priv. wiss. HS | KA | PU |
| Brühl | EU FH | BM | EU |
| Brühl | FH Bund | BM | FB |
| Buxtehude | Hochschule21 | STD | HS |
| Buxtehude | FH Hi/Holzm/Gö | STD | FH |
| Calw | FH f. Wirtsch. u. Med. | CW | FH |
| Calw | intern. Hochschule | CW | HS |
| Celle | Pr. FH Wirtsch. Hann | CE | PF |
| Chemnitz | TU | C | TU |
| Chemnitz-Breitenbrunn | TH | C | TH |
| Clausthal | TU | GS | TU |
| Coburg | Fachhochschule | CO | FH |
| Coburg | HS angew. Wissen. | CO | HS |
| Coburg-Münchberg | FH | CO | F2 |
| Cottbus | HS Lausitz | CB | FH |
| Cottbus | Brandenb. TU | CB | TU |
| Darmstadt | EHD | DA | KF |
| Darmstadt | FH Dieburg | DA | VF |
| Darmstadt | HS | DA | FH |
| Darmstadt | Wilhelm-B. HS | DA | PF |
| Darmstadt | TU | DA | TU |
| Darmstadt | VerwFH | DA | V2 |
| Deggendorf | FH | DEG | FH |
| Dessau | HS Anhalt | DE | FH |
| Detmold | FachHS Lippe | DT | FL |
| Detmold | FH OWL | LIP | H2 |
| Detmold | HS für Musik | LIP | HM |
| Detmold | HS für Musik/alt | DT | HM |
| Dieburg | Verwaltungs-FH | DA | V3 |
| Diepholz | priv. FH | DH | FH |
| Dortmund | FH | DO | FH |
| Dortmund | Folkw. HS Essen | DO | MH |
| Dortmund | ISM | DO | IS |
| Dortmund | Priv. FH Ökonom. | DO | PF |
| Dortmund | Universität | DO | U |
| Dortmund | MuHo Detmold | DO | HM |
| Dortmund | VerwFH | DO | VF |
| Dresden | Euro Business C. | DD | EC |
| Dresden | Ev. HS SozArbeit | DD | FH |
| Dresden | HS Kirchenmusik | DD | HS |
| Dresden | Palucca HS | DD | AK |
| Dresden | PH | DD | PH |
| Dresden | Priv. FH | DD | PF |
| Dresden | Priv. Uni | DD | PU |
| Dresden | Abt. Meissen HS L. | DD | HL |
| Dresden | FH TW. | DD | HT |
| Dresden | HS bild. Künste | DD | HK |
| Dresden | Med. Akad. | DD | MA |
| Dresden | MuHo | DD | HM |
| Dresden | PH Nossen | DD | P2 |
| Dresden | PH Radebeul | DD | P3 |
| Dresden | TU | DD | TU |
| Dresden | Verkehrsw. HS | DD | HV |
| Duesseldorf | Intern. Uni. | D | IU |
| Duisburg | Folkwang-HS | DU | HM |
| Duisburg | Priv. FH | DU | PF |
| Duisburg | Uni | DU | UG |
| Duisburg | FH öff. Verwalt. | DU | VF |
| Duisburg-Essen | Uni | DU | U |
| Düsseldorf | AMD | D | AM |
| Düsseldorf | EBC Priv. FH | D | EB |
| Düsseldorf | Fliedner FH | D | FF |
| Düsseldorf | Priv. FH Ökon. | D | PF |
| Düsseldorf | Fachhochsch. | D | FH |
| Düsseldorf | FH öff. Ver. | D | VF |
| Düsseldorf | Kunstakademie | D | HK |
| Düsseldorf | R.-Schum.-HS | D | HM |
| Düsseldorf | Universität | D | U |
| Eberswalde | HS | BAR | FH |
| Eberswalde | Fachhochschule | EW | FH |
| Eckernförde | FachHS Kiel | ECK | FH |
| Edenkoben | FinanzFH | LD | VF |
| Eichstätt | Kath. Univers. | EI | U |
| Elmshorn | FH | PI | F2 |
| Elsfleth | HS | OL | F2 |
| Elstal | HS dig. Medienpr. | HVL | HS |
| Elstal | Theol. Seminar | HVL | FH |
| Emden | HS | EMD | FH |
| Erding | FH angew. Manag. | ED | PF |
| Erfurt | Fachhochschule | EF | FH |
| Erfurt | Medizin. Akademie | EF | MH |
| Erfurt | Priv. FH Adam-Ries | EF | PF |
| Erfurt | Theol. Fak. | EF | KH |
| Erfurt | Uni | EF | U |
| Erfurt | Universität | EF | PH |
| Erlangen-Nürnberg | Uni | ER | U |
| Essen | FH | E | FH |
| Essen | FH f. Management | E | P2 |
| Essen | Priv. FH f. Berufst. | E | PF |
| Essen | Uni Klinikum | E | UK |
| Essen | Universit. (I) | E | U |
| Essen | Universität | E | UG |
| Essen | Folkwang-Hochschule | E | HM |
| Esslingen | Hochschule | ES | FT |
| Esslingen | FH Sozialwesen | ES | FS |
| Flensburg | FH | FL | FH |
| Flensburg | Uni | FL | PH |
| Flensburg | Universität | FL | U |
| Frankfurt | HfB | F | HB |
| Frankfurt | Prov. S. o. Mang. | F | MS |
| Frankfurt | Universität | F | U |
| Frankfurt | Bibl. FH | F | V2 |
| Frankfurt | FH | F | FH |
| Frankfurt | HS Bild. Küns. | F | HK |
| Frankfurt | MusKunstHS | F | HM |
| Frankfurt | Philos. Theol. HS | F | KH |
| Frankfurt | Provadis School | F | PF |
| Frankfurt | VerwFH | F | VF |
| Frankfurt/Oder | Europauni. | FF | EU |
| Freiberg | TU Bergakademie | FG | U |
| Freiburg | Ev. Hochschule | FR | FH |
| Freiburg | Kath. HS | FR | KF |
| Freiburg | Universität | FR | U |
| Freiburg | MuHo | FR | HM |
| Freiburg | PH | FR | PH |
| Friedberg | THM | FB | FH |
| Friedensau | Theolog. HS | HAL | KH |
| Friedrichshafen | DualHS | FN | DH |
| Friedrichshafen | Zepp. Uni | FN | U |
| Fulda | Fachhochschule | FD | FH |
| Fulda | Theolog. Fakultät | FD | KH |
| Fürstenfeld. | FH f. Verw. | FFB | VF |
| Furtwangen | HS | VS | FH |
| Geisenheim | HSRM | WI | F2 |
| Geislingen | FachHS Ulm | UL | F2 |
| Gelsenk. | FH Recklinghsn. | GE | F3 |
| Gelsenkirchen | FH | GE | FH |
| Gelsenkirchen | FH Bocholt | GE | F2 |
| Gelsenkirchen | VerwFH | GE | VF |
| Gera | SRH FH f. Gesundh. | G | PF |
| Germersheim | Uni Mainz | GER | U |
| Gießen | FTH | GI | FT |
| Gießen | THM | GI | FH |
| Gießen | Verwaltungs-FH | GI | VF |
| Gießen | J.-Liebig-Univer. | GI | U |
| Göppingen | techn. HS | GP | FH |
| Görlitz | FH | ZI | HW |
| Gotha | Verwaltungs FH | GTH | VF |
| Göttingen | FH im DRK | GÖ | HS |
| Göttingen | HS | GÖ | FH |
| Göttingen | G.-Aug.-Univ. | GÖ | U |
| Göttingen | PrivFH | GÖ | PF |
| Greifswald | Uni | GW | U |
| Greifswald | Uni Abt. NB. | NB | U |
| Greifswald | Uni m. Klinik. | GW | U2 |
| Greifswald | Uni o. Klinik. | GW | U1 |
| Greifswald | Uni | HGW | U |
| Güstrow | Baltic College | GÜ | FH |
| Güstrow | Verwaltungs-FH | GÜ | VF |
| Gütersloh | priv. FH d. Ws. | PB | F3 |
| Gütersloh | Priv. FH | GT | PF |
| Hachenburg | FH Dt. Bundesb. | WW | VF |
| Hagen | Fernuni | HA | UG |
| Hagen | FH Südwestfalen | HA | FH |
| Hagen | Märk. FH | HA | F2 |
| Hagen | VerwFH | HA | VF |
| Halberstadt | HS Harz | HBS | FH |
| Halberstadt | Verw. FH | HBS | VF |
| Halle | evang. HS f. Kirchm. | HAL | EH |
| Halle | Kunsthochschule | HAL | HK |
| Halle | PH | HAL | PH |
| Halle | Uni | HAL | U |
| Halle | Abt. Merseb. Uni | HAL | U2 |
| Halle-Köthen | Pädagog. HS | KÖT | PH |
| Halle-Wittenberg | Uni | HAL | UW |
| Hamburg | AMD | HH | AM |
| Hamburg | Bucerius Law S. | HH | BS |
| Hamburg | DFI Brand Acad. | HH | PF |
| Hamburg | EBC | HH | BC |
| Hamburg | Eur. Fernhochs. | HH | EF |
| Hamburg | FH | HH | FH |
| Hamburg | Hafencity Uni. | HH | HU |
| Hamburg | Helm. Schmidt-Uni | HH | UB |
| Hamburg | HFH | HH | FF |
| Hamburg | HS der Polizei | HH | VF |
| Hamburg | HS Fres. Idstein | HH | FI |
| Hamburg | HSBA School | HH | BA |
| Hamburg | Intern. BS | HH | IB |
| Hamburg | MFH München | HH | MF |
| Hamburg | MSH | HH | MS |
| Hamburg | Nordd. Akad. Fin. | HH | HF |
| Hamburg | Uni | HH | U |
| Hamburg | Uni f. Wirts. Pol. | HH | HS |
| Hamburg | Uni Klinikum | HH | UK |
| Hamburg | Ev. FH | HH | FS |
| Hamburg | HS Bild. Künste | HH | HK |
| Hamburg | MuHo | HH | HM |
| Hamburg-Harburg | TU | HH | TU |
| Hameln | HSW | HM | HS |
| Hamm | FH Hamm-Lippstadt | HAM | F2 |
| Hamm | Priv. FH | HAM | FH |
| Hannover | FH Gestaltg. | H | FG |
| Hannover | HS | H | FH |
| Hannover | HS f. Musik | H | HM |
| Hannover | Kommunale FH | H | VF |
| Hannover | Leibniz FH | H | LA |
| Hannover | Universität | H | U |
| Hannover | BiblInf. FH | H | FB |
| Hannover | Ev. FH | H | KF |
| Hannover | MedHo | H | MH |
| Hannover | MilMolk. FH | H | F3 |
| Hannover | PrivFH Wirtsch. | H | PF |
| Hannover | TiHo | H | TI |
| Heide | FH | HEI | FH |
| Heidelberg | HS für Musik | HD | HM |
| Heidelberg | Pädagog. HS | HD | PH |
| Heidelberg | Uni f. jüd. St. | HD | KH |
| Heidelberg | Universität | HD | U |
| Heidelberg | FH | HD | FH |
| Heidenheim | DualHS (BA) | HDH | DH |
| Heilbronn | Duale HS | HN | DH |
| Heilbronn | GermGrad. Sch. | HN | BS |
| Heilbronn | FH | HN | FH |
| Heilbronn-Künzelsau | FH | HN | F2 |
| Hennef | FH Bonn-Rhein-S. | SU | F3 |
| Hennef | Phil.-Theolog. HS | SU | K2 |
| Herford | HS Kirchenmusik | HE | HK |
| Herrsching | FH f. Verw. | STA | V2 |
| Hildesheim | FH Gestaltg. | HI | FG |
| Hildesheim | FH SozPäd. | HI | FS |
| Hildesheim | HS | HI | FH |
| Hildesheim | Nordd. HS | HI | V2 |
| Hildesheim | Priv. Komm. FH | HI | VF |
| Hildesheim | Uni | HI | U |
| Hildesheim | PolizeiFH | HI | V3 |
| Hof | FH | HO | FH |
| Hof | FH Abtlg. Münchberg | HO | F2 |
| Hof | FH f. Verw. | HO | VF |
| Hohenheim | Universität | S | U2 |
| Höhr-Grenzhs. | FH Koblenz | WW | FH |
| Holzminden | HS | HOL | FH |
| Horb | DualHS (BA) | FDS | DH |
| Höxter | FH Lippe | HX | FH |
| Höxter | FH OWL | LIP | H3 |
| Höxter | Uni Paderborn | HX | UG |
| Idar-Oberstein | FH Trier | TR | F3 |
| Idar-Oberstein | FH Mainz I | MZ | F5 |
| Idstein | FH Fresenius | WI | F5 |
| Idstein | FH Wiesbaden | WI | F4 |
| Idstein | HS Fresenius | RÜD | PF |
| Ilmenau | TU | IK | TU |
| Ilmenau | Universität | IL | TH |
| Ingolstadt | FH | IN | FH |
| Ingolstadt | kath. Uni Eich. | IN | U |
| Iserlohn | Bus. a. IT School | MK | TS |
| Iserlohn | FH Südwestfalen | MK | FH |
| Isny | Priv. FH | RV | PF |
| Jena | Fachhochschule | J | FH |
| Jena | Universität | J | U |
| Kaiserslautern | FH KL | KL | FH |
| Kaiserslautern | Techn. U. | KL | U |
| Kamp-Lintford | FH | WES | FH |
| Karlsruhe | DualHS (BA) | KA | DH |
| Karlsruhe | HS | KA | FH |
| Karlsruhe | Intern. Univ. | KA | PF |
| Karlsruhe | KIT | KA | U |
| Karlsruhe | AkBildKünste | KA | HK |
| Karlsruhe | Gestalt. HS | KA | HG |
| Karlsruhe | MuHo | KA | HM |
| Karlsruhe | PH | KA | PH |
| Kassel | CVJM-HS | KS | CV |
| Kassel | DIPLOMA FH | KS | PF |
| Kassel | FH Bund FB LS | KS | FH |
| Kassel | KIMS | KS | MS |
| Kassel | Uni (KunstHS) | KS | U3 |
| Kassel | Uni (ohn. KunstHS) | KS | UG |
| Kassel | VerwFH | KS | VF |
| Kassel-Witzenhsn. | Uni | KS | U2 |
| Kehl | FH öff. Verwaltung | OG | VF |
| Kempten | FH | KE | FH |
| Kiel | Chr.-Albr.-Univers. | KI | U |
| Kiel | FH | KI | FH |
| Kiel | FH Kunst u. Gestalt. | KI | F2 |
| Kiel | FH Machinenwesen | KI | F6 |
| Kiel | Muthesius KunstHS | KI | HK |
| Kiel | FH FB Sozialwesen | KI | F3 |
| Kiel | FH FB Technik | KI | F4 |
| Kiel | FH FB Wirtschaft | KI | F5 |
| Kiel | Pädagog. Hochschule | KI | PH |
| Kleve | FH Rhein-Waal | KLE | FH |
| Koblenz | FH | KO | FH |
| Koblenz | HS f. UnternFhrg. | KO | U3 |
| Koblenz | Uni Kobl.-Landau | KO | U |
| Koblenz | FH Verw.-Polizei | KO | VF |
| Koeln | Intern. Univers. | K | IU |
| Köln | CBS (Priv. FH) | K | CB |
| Köln | FH Mittelstand | K | FM |
| Köln | HS Fresenius Idst. | K | FP |
| Köln | KFH NRW | K | KF |
| Köln | Macromedia FH | K | MF |
| Köln | Priv. FH f. Ökonomie | K | P2 |
| Köln | Uni | K | U |
| Köln | Bibl. FH | K | FB |
| Köln | Dt. SportHS | K | U2 |
| Köln | FH | K | FH |
| Köln | FH Bund- inn. Verw. | K | VF |
| Köln | MedienKunstHS | K | HK |
| Köln | MuHo | K | HM |
| Köln | priv. FH | K | PF |
| Köln | VerwFH | K | V2 |
| Köln-Gummersbach | FH | K | F2 |
| Königswusterhausen | FH | KW | FH |
| Konstanz | FH | KN | FH |
| Konstanz | Priv. Kunst FH | KN | F2 |
| Konstanz | Uni | KN | U |
| Köthen | HS Harz | KÖT | FH |
| Köthen | TH | KÖT | TH |
| Köthen | Uni Halle | KÖT | U |
| Krefeld | HS Niederrhein | KR | FH |
| Lahr | Wissensch. HS | OG | FW |
| Landau | Uni Koblenz-Landau | LD | U |
| Landshut | FH | LA | FH |
| Langen | FH d. Bundes | DA | V4 |
| Leer | HS | LER | FH |
| Leipzig | Ak. D. Privat-HS | L | FB |
| Leipzig | FH DTE | L | F2 |
| Leipzig | Ev. FH | L | KH |
| Leipzig | Graphik. FH | L | H3 |
| Leipzig | HandelsHS | L | HH |
| Leipzig | MuHo | L | HM |
| Leipzig | MuHo (I) | L | H2 |
| Leipzig | PH | L | PH |
| Leipzig | priv. HandelsHS | L | HS |
| Leipzig | Techn. FH | L | HT |
| Leipzig | TH | L | TH |
| Leipzig | Uni | L | U |
| Leuna-Merseburg | Techn. HS | MER | TH |
| Leverk. | Pr. FH Ökonomie | LEV | PF |
| Leverkusen | FH Köln | LEV | FH |
| Lichtenwalde | Spark. FH | FG | FH |
| Lippe | FH Detmold | LIP | F2 |
| Lippe | FH OWL | LIP | H1 |
| Lippe-Lemgo | FH Lemgo | LIP | FH |
| Lippstadt | FH Hamm-Lipps. | SO | F2 |
| Lörrach | DualHS (BA) | LÖ | DH |
| Lübeck | FH | HL | FH |
| Lübeck | FH Bund | HL | VF |
| Lübeck | FH FB Technik | HL | F3 |
| Lübeck | Uni Klinikum | HL | UK |
| Lübeck | Universität | HL | U |
| Lübeck | FH FB Angew. Nat. | HL | F2 |
| Lübeck | MuHo | HL | HM |
| Ludwigsbgur | Hochschule | LB | V2 |
| Ludwigsburg | ev. HS | LB | FH |
| Ludwigsburg | PH | LB | PH |
| Ludwigsburg | PH Abt. Rtl. | LB | P2 |
| Ludwigsburg | FH Finanzen | LB | VF |
| Ludwigshafen | FH | LU | FH |
| Ludwigshafen | Ev. FachHS | LU | KF |
| Lüneburg | Uni | LG | U |
| Lüneburg | Uni Lg. Abt. Lg. FH | LG | FH |
| Magdeburg | Fachhochschule | MD | F2 |
| Magdeburg | FH | MD | FH |
| Magdeburg | TU | MD | TU |
| Magdeburg | HS Magdeb. Std. | MD | F3 |
| Magdeburg | MedAkad. | MD | MH |
| Magdeburg | PH | MD | PH |
| Magdeburg | Uni | MD | U |
| Mainz | FH | MZ | F4 |
| Mainz | Uni Abt. Koblenz-L. | MZ | U2 |
| Mainz | FH Bund Eisenbahnw. | MZ | VF |
| Mainz | FH Rh.-Pf. Mainz I | MZ | F3 |
| Mainz | FH Rh.-Pf. Mainz II | MZ | F2 |
| Mainz | Joh.-Gutenberg-Uni. | MZ | U |
| Mainz | Kath. FH | MZ | KF |
| Mannheim | DualHS (BA) | MA | DH |
| Mannheim | FachHS Gestalt. | MA | FG |
| Mannheim | Hochschule | MA | FT |
| Mannheim | HS d. Bundesag. | MA | BA |
| Mannheim | ArbeitsvewFH | MA | V3 |
| Mannheim | BundesverwFH | MA | V2 |
| Mannheim | HS Musik u. Kunst | MA | HM |
| Mannheim | Soz. FH | MA | FS |
| Mannheim | Uni | MA | U |
| Marburg | Evangelische HS | MR | EH |
| Marburg | Archivw. FH | MR | FH |
| Marburg | Uni | MR | U |
| Marl | Priv. FH Ökonomie | RE | PF |
| Mayen | FH inn. Verwaltung | MYK | VF |
| Meiningen | PolizeiVerwFH | MGN | VF |
| Meißen | FH Sächs. Verw. | MEI | FH |
| Meissen | FH Sächs. Verw. | MEI | FV |
| Meissen | VerwHS FB Finanz | MEI | F2 |
| Merseburg | HS | SK | HS |
| Merseburg | HS (I) | HAL | FH |
| Meschede | FH Südwestfalen | HSK | FH |
| Mettmann | Priv. FH | ME | FH |
| Metzingen | Priv. FH Kunst | RT | HS |
| Minden | FH Bielefeld | MI | FH |
| Mittweida | FH f. Technik | C | FH |
| Mittweida | HS | MW | HT |
| Mittweida | Ing. HS | HC | IH |
| Mittweida | HS f. Techn. Wir. | MTW | HT |
| Mönchenglad. | HS Niederr. | MG | FH |
| Moritzberg | FH f. Relig. | Z | FH |
| Mosbach | DualHS (BA) | MOS | DH |
| Mülheim | FH | MH | FH |
| München | AMD Hamburg | M | AM |
| München | Bund. Uni FH-STG | M | B2 |
| München | Bund. Uni Uni-STG | M | BW |
| München | Business School | M | EA |
| München | FH f. Verw. | M | VF |
| München | HS angew. Sprache | M | AS |
| München | Macrom. FH d. Med. | M | MF |
| München | AkadBildKünste | M | HK |
| München | FernsFilmHS | M | HS |
| München | FH | M | FH |
| München | KathStiftFH | M | KF |
| München | MuHo | M | HM |
| München | PhilHS | M | KH |
| München | PolitHS | M | HP |
| München | Priv. FH Fresen. | M | FP |
| München | TU | M | TU |
| München | Uni | M | U |
| München-Benedi. | Kath. FH | GAP | KS |
| München-Eichs. | kath. Uni | M | U2 |
| München-Weihenstephan | TU | M | T2 |
| Münster | Dt. HS d. Polizei | MS | PH |
| Münster | KFH NRW | MS | KF |
| Münster | Universität | MS | U |
| Münster | FH | MS | FH |
| Münster | FinanzVerwFH | MS | VF |
| Münster | KunstAkad. | MS | HK |
| Münster | MuHo Detmold | MS | HM |
| Münster | Phil. Theol. HS | MS | KH |
| Münster | VerwFH | MS | V2 |
| Naumburg | Kirchl. HS (ev) | NMB | KH |
| Neubrandenburg | HS | NB | FH |
| Neuendettelsau | Augustana | M | AH |
| Neuendettelsau | August. HS | M | K3 |
| Neuss | EUFH | NE | EU |
| Neuss | HS int. Wirtsch. | NE | HS |
| Neuss | Priv. FH | NE | PF |
| Neu-Ulm | FH | NU | FH |
| Nienburg | FH Hannover | H | F2 |
| Nordhausen | FH | NDH | FH |
| Nordkirchen | FH Finanzen | COE | VF |
| Nürnberg | Evang. HS | N | KF |
| Nürnberg | HS f. Musik | N | HM |
| Nürnberg | AkadBildKünste | N | HK |
| Nürnberg | Ev. FH | N | K1 |
| Nürnberg | Ev. FH Abt. Münch. | N | K2 |
| Nürnberg | Ev. FH Abt. Neuen. | N | K3 |
| Nürnberg | FH | N | FH |
| Nürnberg | Uni Erlangen-N. | N | U |
| Nürtingen | Landespf. FH | NT | FH |
| Nürtingen | PrivKunstFH | NT | F3 |
| Nürtingen-Geislingen | FH | GP | F2 |
| Oberlausitz | HS f. ev. KiMu | GR | KH |
| Oberursel | Ev. HS | HG | KH |
| Oestrich-Winkel | Europ. B. S | WI | EB |
| Offenbach | HS Gestaltung | OF | HK |
| Offenburg | FH | FR | F2 |
| Oldenburg | HS | OL | FH |
| Oldenburg | priv. FH | OL | PF |
| Oldenburg | Uni | OL | U |
| Osnabrück | FH / Haste | OS | F2 |
| Osnabrück | HS | OS | FH |
| Osnabrück | HS in Lingen | OS | F3 |
| Osnabrück | Universität | OS | U |
| Osnabrück | Kath. FH Nord. | OS | KF |
| Ottersberg | FH | VER | FH |
| Paderborn | FH f. Wirtsch. | PB | FH |
| Paderborn | KFH NRW | PB | KF |
| Paderborn | Theol. Fakult. | PB | KH |
| Paderborn | Uni | PB | UG |
| Paderborn | Wirts. FH | PB | F1 |
| Paderborn-Meschede | Uni. GH | PB | U2 |
| Passau | Universität | PA | U |
| Pforzheim | FH Gestaltung | PF | FG |
| Pforzheim | FH Wirtschaft | PF | FH |
| Pirmasens | FH KL | PS | FH |
| Plauen | Priv. FH | PL | FH |
| Potsdam | Business School | P | BS |
| Potsdam | FH | P | F2 |
| Potsdam | FH f. Sport | P | SH |
| Potsdam | Uni. of Mang. Com. | P | PF |
| Potsdam | Universität | P | U |
| Potsdam | FH | P | FH |
| Potsdam-Bab. | HS Film/Fer. | P | HF |
| Potsdam-Brandenbg. | FH | BRB | F2 |
| Radebeul | FH d. Verwaltung | DD | F2 |
| Ravensb.-Weing. | FH | RV | FH |
| Ravensburg | DualHS (BA) | RV | DH |
| Regensburg | HS kath. KM. | R | KH |
| Regensburg | Universität | R | U |
| Regensburg | Fachhochschule | R | FH |
| Reinfeld | FH Verw. | RD | V2 |
| Remagen | FH Koblenz | KO | F2 |
| Rendsburg / Pinneberg | HS | RD | BF |
| Rendsburg | FachHS Kiel | RD | FH |
| Reutlingen | ev. FH | RT | FH |
| Reutlingen | Theol. Seminar | RT | TS |
| Reutlingen | FH Techn./Wir. | RT | FT |
| Rheinbach | FH Bonn-Rh. S. | SU | F2 |
| Rheine | Mathias HS | ST | MH |
| Riedlingen | Fernhoschule | BC | F2 |
| Riesa | FH Sächs. Verw. | RIE | FH |
| Rinteln | FH Verwaltung | SHG | VF |
| Rosenheim | FH | RO | FH |
| Rostock | HM | ROS | HM |
| Rostock | Institut f. Musik | ROS | IM |
| Rostock | Priv. Hanseuniv. | HRO | HU |
| Rostock | Universität | HRO | U |
| Rostock | HS f. Musik u. Th. | HRO | HM |
| Rotenburg | VerwFH | ROF | VF |
| Rothenburg | FH Polizei | NOL | FH |
| Rottenburg | FH Forstwirt. | TÜ | FH |
| Rüsselsheim | HSRM | WI | F3 |
| Saarbrücken | FH Bergbau | SB | F2 |
| Saarbrücken | HS f. Musik | SB | HM |
| Saarbrücken | HS f. Präv. | SB | HS |
| Saarbrücken | FH Verwalt. | SB | VF |
| Saarbrücken | HS Bil. Kü. | SB | HK |
| Saarbrücken | HS Tech./Wi. | SB | FH |
| Saarbrücken | Kath. FH So. | SB | KF |
| Saarbrücken | Uni Saarland | SB | U |
| Salzgitter | HS BS-Wb. | SZ | FH |
| Schmalkalden | Fachhochsch. | SM | FH |
| Schwäbisch Gm. | FH Gest. | AA | FG |
| Schwäbisch Gmünd | PH | AA | PH |
| Schwäbisch Hall | HS Techn. | SHA | HT |
| Schwäbisch Hall | priv. FH | SHA | KH |
| Schwandorf | Priv. FH | SAD | PF |
| Schwarzburg | FH f. Forstw. | RU | FH |
| Schweinfurt | FH Würzb.-S. | WÜ | F2 |
| Schwerin | Baltic College | LDS | BC |
| Schwerin | Inst. f. Musik | SN | HM |
| Schwetzingen | FH Rechtspf. | HD | VF |
| Senftenberg | HS Lausitz | SFB | FH |
| Siegen | Priv. FH | SI | PF |
| Siegen | Uni | SI | UG |
| Sigmaringen | HS Albst.-Si. | SIG | FH |
| Soest | FH Südwestfalen | SO | FH |
| Soest | FH f. oeffentl. Verw. | SO | VF |
| Soest | UniGHS Paderborn | SO | UG |
| Speyer | HS f. Verwaltungsw. | SP | U |
| St. Augustin | FH Bonn-Rh. S. | SU | FH |
| St. Augustin | Phil.-TheolHS | SU | KH |
| Starnberg | FH f. Verw. | STA | VF |
| Steinfurt | FachHS Münster | ST | FH |
| Stendal | FH Altmark | SDL | FH |
| Stralsund | FH | HST | FH |
| Stralsund | FH Abt. Heilig. | HST | F2 |
| Straubing | FH Weihenst. | SR | FH |
| Stuttgart | AKAD FH | OG | FH |
| Stuttgart | Duale HS Präs. | S | DP |
| Stuttgart | DualHS (BA) | S | DH |
| Stuttgart | FH d. Medien | S | F2 |
| Stuttgart | Inst. of. Manag. | S | IM |
| Stuttgart | Kath. HS | S | KF |
| Stuttgart | Uni | S | U |
| Stuttgart | VerwAkad. DuHS | S | VA |
| Stuttgart | Waldorfpäd. HS | S | WH |
| Stuttgart | Ak. Bild. Kün. | S | HK |
| Stuttgart | FachHS Technik | S | FH |
| Stuttgart | FH Bibliothekw. | S | FB |
| Stuttgart | HS Musik/Kunst | S | HM |
| Stuttgart | Macromedia FH | S | MF |
| Stuttgart | priv. FH f. Gest. | S | F3 |
| Stuttgart | Uni | S | TH |
| Suderburg | HS BS-Wb. | UE | FH |
| Swisttal | FH Bund | K | V3 |
| Swisttal | FH Bund (I) | K | F3 |
| Trier | FH | TR | FH |
| Trier | Theolog. Fakultät | TR | KH |
| Trier | Universität | TR | U |
| Triesdorf | FH Weihensteph. | AN | F2 |
| Trossingen | HS für Musik | TUT | HM |
| Tübingen | Eb.-Karls-Univ. | TÜ | U |
| Tuttlingen | HS | TUT | F3 |
| Ulm | FH für Technik | UL | FH |
| Ulm | FH Kempten Abt. Ulm | UL | F4 |
| Ulm | Universität | UL | U |
| Vallendar | Theolog. HS | MYK | KH |
| Vechta | priv. FH | VEC | FH |
| Vechta | Univ. | VEC | U |
| Vechta | Kath. FH Norddtld. | VEC | KF |
| Verlbert | FH Bochum | BO | F2 |
| Villingen | FH für Polizei | VS | VF |
| Villingen-Schw. | DualHS | VS | DH |
| Villingen-Schw. | HS V-S. | VS | F2 |
| Warnemünde-Wustrow | HS See | ROS | HS |
| Wasserburg | FH f. Verw. | RO | VF |
| Wedel | PrivFH | PI | FH |
| Weihenstephan | FH | FS | FH |
| Weimar | HS für Musik | WE | HM |
| Weimar | Universität | WE | U |
| Weimar | Verw. FH | WE | VF |
| Weimar | HS Archit./Bauwes. | WE | TH |
| Weingarten | Pädagog. HS | KN | PH |
| Weingarten | PH | RV | PH |
| Weißenfels | HS f. GesWes. | WSF | PF |
| Wernigerode | HS Harz | WR | FH |
| Wernigerode | Verw. FH | WR | V2 |
| Wernigerode | VerwFH | QLB | VF |
| Wetzlar | THM | LDK | FH |
| Wiesbaden | EBS U Wirtsch. | WI | BS |
| Wiesbaden | FH Bund | WI | V1 |
| Wiesbaden | HSRM | WI | FH |
| Wiesbaden | VerwFH | WI | VF |
| Wildau | THS | KW | TH |
| Wilhelmshaven | HS | WHV | FH |
| Wismar | FH | HWI | FH |
| Wismar | TH | WIS | TH |
| Wismar-Warnemünde | FH | WIS | FH |
| Witten-Herd. | Priv. Uni | EN | U |
| Wolfenbüttel | HS BS-Wb. | WF | FH |
| Wolfsburg | HS BS-Wb. | WOB | FH |
| Worms | FH | WO | FH |
| Wuppertal | HS Musik Köln | W | HM |
| Wuppertal | Kirchliche HS | W | KH |
| Wuppertal | Uni | W | UG |
| Wuppertal | FH öff. Verw. | W | VF |
| Würzburg | HS für Musik | WÜ | HM |
| Würzburg | J.-Max.-Uni. | WÜ | U |
| Würzburg | FH Würzb-Schw. | WÜ | FH |
| Würzburg-Aschaffenbg. | FH | WÜ | F3 |
| Zittau | FH | ZI | HT |
| Zittau | Intern. HS Instit. | ZI | IH |
| Zittau | TH | ZI | TH |
| Zweibrücken | FH KL | ZW | FH |
| Zwickau TH | Abt. Glauchau | Z | T3 |
| Zwickau TH | Abt. Plauen | Z | T2 |
| Zwickau | HS Fresenius | Z | PF |
| Zwickau | HS Schneeberg | Z | HS |
| Zwickau | PH | Z | PH |
| Zwickau | TH | Z | TH |
| Zwickau | TU | Z | TU |
| Zwickau | Westsächs. HS | Z | HT |
| Zwickau | Wests. HS(Reichb.) | RC | HS |
| Zwickau-Auerbach | PH | Z | P2 |

View File

@@ -0,0 +1,40 @@
# Basic setup for development
## Required tools/packages
* [SSH](https://docs.gitlab.com/ee/ssh/README.html)
* [Git](https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html)
* [Docker](https://docs.gitlab.com/ee/user/project/container_registry.html) & Docker-Compose
* Node.js & NPM - be sure to install the "Fermium" (14.x) LTS version, might need a [PPA](https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions) or use NVM
* [NVM](https://github.com/creationix/nvm#installation) - if you want to use multiple different versions of node
Example for Debian based distributions:
```shell
apt install ssh git docker docker-compose nodejs
```
## IDE - recommended choices
* [VSCode](https://code.visualstudio.com/)
* [Webstorm](https://www.jetbrains.com/webstorm/download/) - Educational or OpenSource License **cannot** be used
## Optional helpful tools
* Curl - for executing HTTP requests on the command line
* Postman or Insomnia - for executing HTTP requests with a GUI
## Before you start (Windows only)
As we are working on LF line-endings only, make sure your editior or IDE does not introduce CRLF line-endings.
Depending on your preferred settings you could consider applying `git config core.eol lf` and `git config core.autocrlf input` within our reposiories.
## Clone starter repositories
* [Minimal deployment](https://gitlab.com/openstapps/minimal-deployment) - contains backend, database, minimal connector, copy (from api) and app
* [Minimal connector](https://gitlab.com/openstapps/minimal-connector) - an example connector to learn the principles of connector development
```shell
git clone git@gitlab.com:openstapps/minimal-deployment.git
git clone git@gitlab.com:openstapps/minimal-connector.git
```

View File

@@ -0,0 +1,25 @@
# Branching model
## Possible branch names
* `master`
* `develop`
* `$ID-$TITLE`
### `master`
Current productive version of a project resides on the `master` branch.
### `develop`
The upcoming productive version - current development version - resides on the `develop` branch. The `develop` branch is unnecessary in smaller projects when the development is not too fast.
The `master` branch needs to be updated with a fast forward merge after every release in projects that have a `develop` branch.
### `$ID-$TITLE`
Development of features, bugfixes or refactoring is done in branches referencing an issue that follow the naming convention `$ID-$TITLE` where `$ID` is the number of the issue and `$TITLE` is the sluggified title of the issue. The [issues](ISSUES.md) integration of GitLab has a feature that creates such a branch and an accompanying merge request.
## Further resources
* [Git - A successful Git branching model](http://nvie.com/posts/a-successful-git-branching-model/)

View File

@@ -0,0 +1,21 @@
# Coding style
These guidelines are meant for TypeScript based project but can be adapted for projects that are developed in other languages as well.
## Configuration
Consistent code structure and style is ensured by using [`@openstapps/configuration`](https://gitlab.com/openstapps/configuration). It contains configuration files for your editor, the TypeScript compiler and TSLint.
When you install this project and are missing any of the recommended configuration files, they will be automatically created for you.
## Comments
Plenty of inline comments should be used to make it easier to understand what the code is doing.
Inline comments should not explain what code from external projects is doing. Add missing documentation to those external projects.
## Further resources
* [Commit guidelines](COMMITS.md)
* [TypeScript coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines)
* [Licensing guidelines](LICENSING.md)

View File

@@ -0,0 +1,60 @@
# Commit guidelines
## Template
Commit subjects should match the following template:
> `TYPE`: `SUBJECT`
>
> `DESCRIPTION`
### `TYPE`
`TYPE` can have one of the following values:
| value | meaning |
| --- | --- |
| build | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| docs | Documentation only changes |
| feat | A new feature |
| fix | A bug fix |
| perf | A code change that improves performance |
| refactor | A code change that neither fixes a bug nor adds a feature |
| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| test | Adding missing tests or correcting existing tests |
These are the [types](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type), that angular uses. They are easily adaptable for all TypeScript based web related projects.
### `SUBJECT`
`SUBJECT` should be written in the imperative mood. You can think of a short subject that completes a sentence that starts with "This commit will...".
The first line of the commit subject should not be longer than 50 chars overall.
### `DESCRIPTION`
`DESCRIPTION` can contain a longer description of the commit. Each line should not be longer than 70 chars. New lines can be used to structure the description.
To reference or close [issues](ISSUES.md) GitLab [keywords](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html) can be used in the last line(s) of the description:
> Fixes #42
or
> References #42
## Advantages
The result of those commit guidelines is a concise and clear history of the development.
Another advantage is the automatic [generation](https://www.npmjs.com/package/conventional-changelog-cli) of a changelog that gives an overview of the changes.
```shell
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
```
## Further resources
* [Recommendations on commit messages](https://chris.beams.io/posts/git-commit/)
* [Versioning](VERSIONING.md)

View File

@@ -0,0 +1,84 @@
# Documentation
Every projects need a `README.md` as a standardized entry of information about the scope of a [project](PROJECT.md) and how to install and execute it.
## Inline (code) documentation
Code is annotated with [TypeDoc](https://typedoc.org/), which then can be used to generate complete documentations of the API of the code.
### Guidelines
Please follow these guidelines to reduce redundance:
* The purpose of inline documentation is to explain what the line of code actually does without explaining syntax or external references. Example:
```typescript
// extend the template by the properties of the base template
templateBase.properties = mergeObjects(
templateBase.properties,
templates['base.template.json'].mappings._default_.properties
);
```
* Follow the [recommendations](http://typedoc.org/guides/doccomments/) of `typedoc`, because it is used to generate documentation. Do not denote the types again in the documentation (`@param` and `@returns`), because they are already "documented" in the code itself. Example:
```typescript
/**
* Gets a value from the storage using the provided key
*
* @param key Unique identifier of the wanted resource in storage
*/
async get<T>(key: string): Promise<T> {
const entry = await this.storage.get(key);
if (!entry) {
throw new Error('Value not found.');
}
return entry;
}
```
### Inline Comments `//`
* Start inline comments with a lowercase letter and a space after the `//`
* Place the comment above the line that it is referencing
```typescript
// lorem ipsum
const lorem;
```
### Doc Comments `/**`
* Start with a capital letter
* Keep the first line short
* The first line should not end with a period, nor should it consist of multiple sentences
* The first line should be easily scannable
* If you want to comment more than one line, do a short summary in the first line, then continue after a blank line with the more detailed description
* Document all parameters in functions using `@param`
* `@param` must not contain a type annotation, just `@param name description`
* Do not include `@return`, as it is redundant information
```typescript
/**
* Short summary of the function, without a period
*
* This is a very long description, that could never possibly fit on one line, nor could it
* be read in a short amount of time. Because we can use multiple sentences here, we can actually
* use a period.
*
* @param foo This parameter does something
*/
function fun(foo: number): Foo {
```
## `CONTRIBUTING.md`
Every project can have a `CONTRIBUTING.md` which explains how to contribute to the project either just by issues or code contributions.
## Issue templates
The path `.gitlab/issue_templates` can contain markdown files which act as templates for issues. These are available as an options during issue creation and just have to be filled by the creator of the issue. They act as orientation which information need sto be provided.
## Further resources
* [GitLab issue templates](https://gitlab.com/help/user/project/description_templates.md)

View File

@@ -0,0 +1,9 @@
# Issues
Regardless of scope - bug, feature, discussion - technical or organisational - everything is an issue.
Issues keep a discussion of the topic, are related to a [branch](BRANCHING.md), keep track of the progress, link to related issues and streamline the process of development.
## Further resources
* [Always start with an issue](https://about.gitlab.com/2016/03/03/start-with-an-issue/)

View File

@@ -0,0 +1,48 @@
# Licensing guidelines
This and affiliated projects are licensed under GPLv3 or APGLv3, if not stated otherwise.
## Licensing projects
Copy the license from [projectmanagement](../../LICENSE) or the [official standalone](https://www.gnu.org/licenses/gpl-3.0-standalone.html) (with the filename `LICENSE`) into the root of your project.
## The GPL copyright notice
According to the GPLv3 guidelines for [adding the license to a new program](http://www.gnu.org/licenses/gpl-3.0-standalone.html#howto) a license note should be added at the beginning of each source file.
```typescript
/*
* Copyright (C) <year> StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
```
### New Files
The `<year>` should be inserted with the current year. E.g.:
```typescript
* Copyright (C) 2019 StApps
```
### Updating Files
If the file is updated in a new year after its creation, the `<year>` should be appended as a comma seperated list with spaces in between. E.g.:
```typescript
* Copyright (C) 2018, 2019, 2021 StApps
```
## Further resources
* [Coding style](CODING.md)

View File

@@ -0,0 +1,14 @@
# Merging & merge requests
Once development of an [issue](ISSUES.md) on a [branch](BRANCHING.md) is completed the merge request becomes relevant. It also can be used during development for continuous reviews and iterative improvements.
A merge request can also gather the work of multiple issues.
Merge requests are used to merge the changes to the main branches (`master`, `develop`). Every merge request needs to be reviewed/commented by at least 2 other developers before they can be accepted. This ensure that all guidelines are followed and that the scope of the issue is matched.
Before any merge of an `issue`-branch into the according `master`-branch, the commits of the `issue`-branch shall be tidied up.
Unstage your commits from the `issue`-branch (`git reset master`). Create your new commit(s) and push them to the remote repository (`git push --force`).
## Further resources
* [Commits](COMMITS.md)

View File

@@ -0,0 +1,37 @@
# Project
A project is an entity that solves a specific task.
Abstractable components of multiple projects should be extracted into another new project.
Node.js projects are published on NPMjs.com in the `@openstapps` group.
## Structure
Node.js/TypeScript based projects should employ the following structure:
```
src/ Sources
test/ Test files
lib/ Compiled sources
cli.js cli tool
index.js API (classes, function, constants, ...)
index.d.ts TypeScript definitions for API
.editorconfig
.gitignore List of files that should be ignored by git
.npmignore List of files that should be ignored by npm
package.json Package description
package-lock.json Meta file, that fixates dependencies
README.md Description of project, entry point for documentation
tsconfig.json TypeScript configuration
tslint.json TSLint configuration
```
### `@openstapps/configuration`
For the contents and purpose of `.editorconfig`, `tsconfig.json` and `tslint.json` refer to `@openstapps/configuration`.
## Further resources
* [Coding style](CODING.md)
* [Versioning](VERSIONING.md)

View File

@@ -0,0 +1,37 @@
# Publishing
## NPM
All projects that use the [OpenStApps configuration](https://gitlab.com/openstapps/configuration) and implement the automatic publishing via GitLab CI can simply be published to the NPM registry by using the appropriate job. It uses the `NPM_AUTH_TOKEN` that is a [protected variable](https://gitlab.com/groups/openstapps/-/settings/ci_cd) of the OpenStApps group. To trigger this job, a new tag has to be created (on the master branch):
### Use current [master branch](BRANCHING.md)
```shell
git checkout master
git pull
```
### Update [version](VERSIONING.md)
```shell
npm version (major|minor|patch)
```
After these steps there should 2 new commits:
* A version commit
* A changelog commit
Also a new git tag should be created.
**CAUTION: Make sure that everything was successful, before running the next command, that pushes commits to GitLab!**
### Pushing commits and version tag created in previous step
To push the previously created commits and version tag you can use the following convenience script:
```shell
npm run push
```
After you've pushed the commits and tags a pipeline will be started for the tag that includes a job that will automatically publish a new package to the NPM registry.

View File

@@ -0,0 +1,15 @@
# Versioning guidelines
We use semantic version through `npm`.
* `npm version patch`: For fixes/patches
* `npm version minor`: For new features
* `npm version major`: For breaking changes in the API
Or directly with `git tag vMAJOR.MINOR.PATCH`.
This tag is set on the `develop`- (if present) or on the `master`-[branch](BRANCHING.md).
## Further resources
* [Commit guidelines](COMMITS.md)

View File

@@ -0,0 +1,58 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>whitesource/merge-confidence:beta",
"config:base",
":semanticCommits",
":semanticCommitTypeAll(refactor)",
":semanticCommitScopeDisabled"
],
"prCreation": "not-pending",
"timezone": "Europe/Berlin",
"groupName": "all",
"packageRules": [
{
"matchPackagePatterns": ["^@krlwlfrt"],
"enabled": false
},
{
"matchUpdateTypes": ["major"],
"matchPackagePatterns": ["^@angular", "^@ionic", "^@types\/node$", "^got$"],
"enabled": false
},
{
"matchPackagePatterns": ["^@types\/geojson$"],
"allowedVersions": "1.0.6"
},
{
"matchPackagePatterns": ["^@elastic\/elasticsearch$"],
"allowedVersions": "<6.0"
},
{
"matchPackagePatterns": ["^typedoc$"],
"allowedVersions": "<0.23"
},
{
"matchPackagePatterns": ["^typescript$"],
"allowedVersions": "<4.5"
},
{
"matchPackagePatterns": ["^chalk$"],
"allowedVersions": "<5.0"
},
{
"matchDepTypes": [
"peerDependencies"
],
"rangeStrategy": "replace"
}
],
"lockFileMaintenance": {
"enabled": true
},
"reviewers": [
"abcdev",
"jovankrunic",
"theaninova"
]
}

View File

@@ -0,0 +1,85 @@
/*
* Copyright (C) 2019-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Api} from '@openstapps/gitlab-api';
import {Logger} from '@openstapps/logger';
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level';
import {Colorize} from '@openstapps/logger/lib/transformations/colorize';
import {Command} from 'commander';
import {existsSync, readFileSync} from 'fs';
import path from 'path';
import {cwd, stdout} from 'process';
import {GITLAB_API_URL} from './configuration';
import {getUsedVersionMajorMinor} from './tasks/get-used-version';
import {remind} from './tasks/remind';
import {tidy} from './tasks/tidy';
import {unlabel} from './tasks/unlabel';
// add default handler for unhandled rejections
process.on('unhandledRejection', async reason => {
await (reason instanceof Error
? Logger.error('Unhandled rejection', reason.stack)
: Logger.error('Unhandled rejection', reason));
process.exit(1);
});
// instantiate new commander
const commander = new Command('openstapps-projectmanagement');
// error on unknown commands
commander.on('command:*', async () => {
await Logger.error(
'Invalid command: %s\nSee --help for a list of available commands.',
commander.args.join(' '),
);
process.exit(1);
});
const gitlabApi = new Api(GITLAB_API_URL, process.env.GITLAB_PRIVATE_TOKEN as string);
Logger.setTransformations([new AddLogLevel(), new Colorize()]);
// eslint-disable-next-line unicorn/prefer-module
if (existsSync(path.join(__dirname, 'package.json'))) {
// eslint-disable-next-line unicorn/prefer-module
commander.version(JSON.parse(readFileSync(path.join(__dirname, '..', 'package.json')).toString()).version);
}
commander.command('unlabel').action(async () => {
await unlabel(gitlabApi);
Logger.ok('Done!');
});
commander.command('tidy').action(async () => {
await tidy(gitlabApi);
Logger.ok('Done!');
});
commander.command('remind').action(async () => {
await remind(gitlabApi);
Logger.ok('Done!');
});
commander.command('get-used-version <dependency> [path]').action(async (dependency, filePath) => {
let fallbackPath = cwd();
if (typeof filePath === 'string' && filePath.length > 0) {
fallbackPath = path.resolve(filePath);
}
stdout.write(await getUsedVersionMajorMinor(fallbackPath, dependency));
});
commander.parse(process.argv);

View File

@@ -0,0 +1,75 @@
/*
* Copyright (C) 2018-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {asyncPool} from '@krlwlfrt/async-pool';
import {Api} from '@openstapps/gitlab-api';
import {Group, Project} from '@openstapps/gitlab-api/lib/types';
import {Logger} from '@openstapps/logger';
import {readFile, writeFile} from 'fs';
import {promisify} from 'util';
import {CONCURRENCY} from './configuration';
/**
* Promisified version of readFile
*/
export const readFilePromisified = promisify(readFile);
/**
* Promisified version of writeFile
*/
export const writeFilePromisified = promisify(writeFile);
/**
* Get projects for a list of groups
*
* @param api GitLab API to make requests with
* @param groups List of groups
*/
export async function getProjects(api: Api, groups: number[]): Promise<Project[]> {
Logger.info(`Fetching all projects for specified groups (${groups.length})...`);
const projectResults = await asyncPool(CONCURRENCY, groups, async groupId => {
return api.getProjectsForGroup(groupId);
});
const projects = flatten2dArray(projectResults);
Logger.log(`Fetched ${projects.length} project(s).`);
return projects;
}
/**
* Get subgroups for a list of groups
*
* @param api GitLab API to make requests with
* @param groups List of groups
*/
export async function getSubGroups(api: Api, groups: number[]): Promise<Group[]> {
return flatten2dArray(
await asyncPool(CONCURRENCY, groups, async groupId => {
return api.getSubGroupsForGroup(groupId);
}),
);
}
/**
* Flatten 2d array
*
* @param array Flattened array
*/
export function flatten2dArray<T>(array: T[][]): T[] {
// eslint-disable-next-line unicorn/prefer-spread
return ([] as T[]).concat(...array);
}

View File

@@ -0,0 +1,213 @@
/*
* Copyright (C) 2018-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Label} from '@openstapps/gitlab-api/lib/types';
import moment from 'moment';
/**
* List of schools with their IDs
*/
export const SCHOOLS: {[school: string]: number} = {};
/**
* ID OF openstapps main group
*/
const STAPPS_GROUP_ID = 4_088_298;
/**
* List of group IDs to fetch issues for
*/
export const GROUPS: number[] = [
STAPPS_GROUP_ID,
...Object.keys(SCHOOLS).map(school => {
return SCHOOLS[school];
}),
];
/**
*
*/
export const LABEL_WEIGHTS: {[key: string]: number} = {
bug: 1,
critical: 2,
};
/**
* List of labels to print bold in report
*/
export const BOLD_LABELS: string[] = ['bug', 'critical'];
/**
* GitLab API URL
*/
export const GITLAB_API_URL = 'https://gitlab.com/api/v4/';
/**
* Milestones to add to projects
*/
export const NEEDED_MILESTONES = ['Backlog'];
/**
* Protected branches
*/
export const PROTECTED_BRANCHES = ['develop', 'master'];
/**
* Labels to add to all projects
*/
export const NEEDED_LABELS: Label[] = [
// eslint-disable-next-line unicorn/no-useless-spread
...[
{
color: '#FF0000',
description: 'An error/something that is not working as expected',
name: 'bug',
},
{
color: '#5CB85C',
name: 'consistency',
},
{
color: '#FF0000',
name: 'confirmed',
},
{
color: '#FF0000',
description: 'A blocking issue/something that needs to be fixed ASAP',
name: 'critical',
},
{
color: '#428BCA',
name: 'design',
},
{
color: '#0033CC',
description: 'An issue about the documentation of the software',
name: 'documentation',
},
{
color: '#5CB85C',
name: 'Doing',
},
{
color: '#5CB85C',
description: 'A feature proposal/something that will be developed',
name: 'feature',
},
{
color: '#7F8C8D',
description: 'An issue that is unimportant or invalid',
name: 'invalid',
},
{
color: '#FFFF88',
name: 'meeting',
},
{
color: '#8E44AD',
name: 'organization',
},
{
color: '#FF0000',
description: 'An issue with the performance of the software',
name: 'performance',
},
{
color: '#69D100',
name: 'refactoring',
},
{
color: '#FF0000',
description: 'An issue with the security of the software',
name: 'security',
},
{
color: '#D1D100',
description: 'An issue about the testing procedure of the software',
name: 'testing',
},
{
color: '#F0AD4E',
name: 'To Do',
},
{
color: '#A8D695',
description: 'An issue with low priority',
name: 'unimportant',
},
{
color: '#D10069',
description: 'An issue with the usability of the software',
name: 'usability',
},
{
color: '#428BCA',
description: 'Feedback from the feedback-module of the app',
name: 'user-feedback',
},
],
...Object.keys(SCHOOLS).map(school => {
return {
color: '#F0AD4E',
description: 'An issue that specifically applies to this school',
name: `school-${school}`,
};
}),
...['android', 'iOS', 'web', 'node'].map(platform => {
return {
color: '#FFECDB',
description: 'An issue that specifically applies to this platform',
name: `platform::${platform}`,
};
}),
];
/**
* Prefix for automatically created notes
*/
export const NOTE_PREFIX = '`openstapps/projectmanagement`';
/**
* Slack channel to post messages to
*/
export const SLACK_CHANNEL = 'C762UG76Z';
/**
* Concurrency for async pool
*/
export const CONCURRENCY = 3;
/**
* Maximum depth for merge request reminders
*/
export const MAX_DEPTH_FOR_REMINDER = 2;
/**
* Next meeting
*/
export const NEXT_MEETING = moment()
.startOf('week')
// tslint:disable-next-line:no-magic-numbers
.hour(10)
// tslint:disable-next-line:no-magic-numbers
.day(3);
if (NEXT_MEETING.isBefore(moment())) {
NEXT_MEETING.add(1, 'week');
}
/**
* Last meeting
*/
export const LAST_MEETING = moment(NEXT_MEETING).subtract(1, 'week');

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2019-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {existsSync, PathLike} from 'fs';
import path from 'path';
import {readFilePromisified} from '../common';
/**
* Get used version of a dependency of a project referenced by a path
*
* @param directoryPath Path to a Node.js project directory
* @param dependency Dependency to get used version of
*/
export async function getUsedVersion(directoryPath: PathLike, dependency: string): Promise<string> {
if (!existsSync(path.join(directoryPath.toString(), 'package.json'))) {
throw new Error(`'package.json' does not exist in '${directoryPath}'. Not a Node.js project?`);
}
const buffer = await readFilePromisified(path.join(directoryPath.toString(), 'package.json'));
const content = buffer.toString();
const packageJson = JSON.parse(content);
if (typeof packageJson.dependencies !== 'object') {
throw new TypeError(`Project in '${directoryPath}' has no dependencies!`);
}
if (typeof packageJson.dependencies[dependency] !== 'string') {
throw new TypeError(`Project in '${directoryPath}' does not depend on '${dependency}'.`);
}
return packageJson.dependencies[dependency];
}
/**
* Get 'MAJOR.MINOR' part of a used version
*
* See [[getUsedVersion]].
*
* @param path see [[getUsedVersion]]
* @param dependency see [[getUsedVersion]]
*/
export async function getUsedVersionMajorMinor(path: PathLike, dependency: string): Promise<string> {
const usedVersions = await getUsedVersion(path, dependency);
const versionMatch = usedVersions.match(/([0-9]+\.[0-9]+)\.[0-9]+/);
// istanbul ignore if
if (versionMatch === null) {
throw new Error(`Used version of '${dependency}' of project in '${path}' could not be determined.`);
}
return versionMatch[1];
}

View File

@@ -0,0 +1,189 @@
/*
* Copyright (C) 2019-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {asyncPool} from '@krlwlfrt/async-pool';
import {Api} from '@openstapps/gitlab-api';
import {
AccessLevel,
MembershipScope,
MergeRequestMergeStatus,
MergeRequestState,
Scope,
User,
} from '@openstapps/gitlab-api/lib/types';
import {Logger} from '@openstapps/logger';
import {WebClient} from '@slack/client';
import {CONCURRENCY, GROUPS, MAX_DEPTH_FOR_REMINDER, NOTE_PREFIX, SLACK_CHANNEL} from '../configuration';
/**
* Remind people of open merge requests
*
* @param api GitLab API to make requests with
*/
export async function remind(api: Api): Promise<void> {
// get list of open merge requests
const allMergeRequests = await api.getMergeRequests(
MembershipScope.GROUPS,
GROUPS[0],
MergeRequestState.OPENED,
);
const mergeRequests = allMergeRequests.filter(mergeRequest => {
const parts = mergeRequest.web_url.split('/');
// remove protocol, server name and main group
parts.splice(0, parts.indexOf('gitlab.com') + 1 + 1);
// remove merge_requests and INDEX parts
parts.splice(-1 - 1);
return parts.length <= MAX_DEPTH_FOR_REMINDER;
});
Logger.info(`Found ${mergeRequests.length} open merge requests.`);
// instantiate slack client
const client =
typeof process.env.SLACK_API_TOKEN !== 'undefined'
? new WebClient(process.env.SLACK_API_TOKEN)
: undefined;
// get members of main group
const members = await api.getMembers(MembershipScope.GROUPS, GROUPS[0]);
// filter members with at least maintainer status
const maintainers = members.filter(member => member.access_level >= AccessLevel.Maintainer);
// extract maintainer's usernames
const maintainerUsernames = maintainers.map(maintainer => maintainer.username);
// sort maintainer's usernames alphabetically
maintainerUsernames.sort((a, b) => {
return a.localeCompare(b);
});
Logger.info(`Found ${maintainers.length} maintainer(s).`);
await asyncPool(CONCURRENCY, mergeRequests, async mergeRequest => {
// check if merge request is WIP
if (mergeRequest.work_in_progress) {
Logger.info(`Merge request '${mergeRequest.title}' is WIP.`);
return;
}
// get merge request approval
const approval = await api.getMergeRequestApproval(mergeRequest.project_id, mergeRequest.iid);
// get merge request discussions
const discussions = await api.getMergeRequestDiscussions(mergeRequest.project_id, mergeRequest.iid);
// check if at least one of the discussions is unresolved
const hasUnresolvedDiscussions = discussions.some(discussion => {
return discussion.notes.some(note => {
return note.resolvable && (typeof note.resolved === 'undefined' || !note.resolved);
});
});
if (hasUnresolvedDiscussions) {
let recipient = mergeRequest.author.username;
if (typeof mergeRequest.assignee !== 'undefined' && mergeRequest.assignee !== null) {
recipient = mergeRequest.assignee.username;
}
// create note in merge request
await api.createNote(
mergeRequest.project_id,
Scope.MERGE_REQUESTS,
mergeRequest.iid,
`${NOTE_PREFIX} Please resolve pending discussions, @${recipient}!`,
);
return;
}
if (approval.merge_status === MergeRequestMergeStatus.CAN_BE_MERGED) {
if (approval.approvals_left > 0) {
Logger.warn(`Merge request '${mergeRequest.title}' needs more approvals!`);
// get possible appropers, prefixed with '@' and joined with commas
const possibleApprovers = maintainerUsernames
.filter(username => {
if (mergeRequest.assignee.username === username) {
return false;
}
if (username.includes('openstapps') || username.includes('kphilipp')) {
return false;
}
if (approval.approved_by.length === 0) {
return true;
}
return approval.approved_by.find(
(approver: {
/**
* Possible approver
*/
user: User;
}) => {
return approver.user.username !== username;
},
);
})
.map(username => `@${username}`)
.join(' ');
// send message to slack
await client?.chat.postMessage({
channel: SLACK_CHANNEL,
text: `Merge request '${mergeRequest.title}' needs more approvals! See ${mergeRequest.web_url}!`,
});
// assign reviewers
await api.createNote(
mergeRequest.project_id,
Scope.MERGE_REQUESTS,
mergeRequest.iid,
`/assign_reviewer ${possibleApprovers}`,
);
} else {
Logger.log(`Merge request '${mergeRequest.title}' is ready to be merged!`);
// send message to slack
await client?.chat.postMessage({
channel: SLACK_CHANNEL,
text: `Merge request '${mergeRequest.title}' is ready to be merged! See ${mergeRequest.web_url}!`,
});
// prefix maintainers with '@' and join with commas
const possibleMergers = maintainerUsernames
.filter(username => {
return mergeRequest.assignee.username !== username;
})
.map(username => `@${username}`)
.join(', ');
// create note in merge request
await api.createNote(
mergeRequest.project_id,
Scope.MERGE_REQUESTS,
mergeRequest.iid,
`${NOTE_PREFIX} Merge request is ready to be merged, ${possibleMergers}!`,
);
}
}
});
}

View File

@@ -0,0 +1,468 @@
/*
* Copyright (C) 2018-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {asyncPool} from '@krlwlfrt/async-pool';
import {Api} from '@openstapps/gitlab-api';
import {
Issue,
IssueState,
MembershipScope,
MergeRequestState,
Project,
User,
} from '@openstapps/gitlab-api/lib/types';
import {Logger} from '@openstapps/logger';
import moment from 'moment';
import {render} from 'mustache';
import path from 'path';
import {cwd} from 'process';
import {flatten2dArray, getProjects, readFilePromisified, writeFilePromisified} from '../common';
import {BOLD_LABELS, CONCURRENCY, GROUPS, LABEL_WEIGHTS, NEXT_MEETING} from '../configuration';
/**
* A structure for template compilation
*/
export interface StructureForTemplate {
/**
* List of issues by assignee
*/
issuesByAssignee: AssigneeWithIssues[];
/**
* Meeting day
*/
meetingDay: string;
/**
* Timestamp, when the report was generated
*/
timestamp: string;
}
/**
* A map
*/
export interface IssuesGroupedByAssigneeId {
[assigneeId: number]: AssigneeWithIssues;
}
/**
* An assignee with assigned issues
*/
export interface AssigneeWithIssues {
/**
* Assignee of the issues
*/
assignee: User;
/**
* Counts of issues
*/
issueCounts: {
/**
* Count of closed issues
*/
closed: number;
/**
* Count of opened issues
*/
opened: number;
};
/**
* List of issues
*/
issues: IssueWithMeta[];
/**
* Quota of closed issues
*/
quota: number;
}
/**
* Issue with meta information
*/
export interface IssueWithMeta extends Issue {
/**
* Whether or not an issue branch exists
*/
$branchExists: boolean;
/**
* Whether or not the issue is closed
*/
$closed: boolean;
/**
* List of labels
*/
$labels: Array<{
/**
* Whether or not to print the label bold
*/
bold: boolean;
/**
* Actual label
*/
label: string;
}>;
/**
* URL of merge request
*/
$mergeRequestUrl: string;
/**
* Name of project
*/
$project: string;
/**
* Number of weeks the issue is open
*/
$weeksOpen: number;
}
/**
* Merge request data
*/
export interface MergeRequestsForProjects {
[projectId: string]: Array<{
/**
* IID of issue
*/
issue_iid: number;
/**
* URL of issue
*/
web_url: string;
}>;
}
/**
* Check if issue state is opened or closed
*
* @param state State to check
*/
export function issueStateIsOpenedOrClosed(
state: IssueState,
): state is IssueState.OPENED | IssueState.CLOSED {
return ['opened', 'closed'].includes(state);
}
/**
* Get merge request URLs from given data
*
* @param projectMergeRequests Merge requests data (object containing array of objects)
* @param projectId Project ID to get data about merge requests for
* @param issueIid Issue IID in certain project (relative ID, and not issue's GitLab API ID)
*/
export function getMergeRequestUrls(
projectMergeRequests: MergeRequestsForProjects,
projectId: number,
issueIid: number,
): string[] {
if (
typeof projectMergeRequests[projectId] === 'undefined' ||
projectMergeRequests[projectId].length === 0
) {
return [];
}
return projectMergeRequests[projectId]
.filter(object => {
return object.issue_iid === issueIid;
})
.map(object => {
return object.web_url;
});
}
/**
* Get issues from all groups with a specific milestone
*
* @param api GitLab API to make requests with
* @param label Label to filter by
* @param groups List of groups to get issues for
*/
export async function getIssues(api: Api, label: string, groups: number[]): Promise<Issue[]> {
const issueResults = await asyncPool(CONCURRENCY, groups, async groupId => {
return api.getIssues({
groupId: groupId,
});
});
const issues = flatten2dArray(issueResults).filter(issue => {
return issue.labels.includes(label);
});
Logger.log(`Fetched ${issues.length} issue(s).`);
return issues;
}
/**
* Get IDs of issues with branches for projects
*
* @param api GitLab API To make requests with
* @param projects List of projects
*/
export async function getIssueBranches(api: Api, projects: Project[]): Promise<{[k: string]: number[]}> {
const projectBranches: {[k: string]: number[]} = {};
await asyncPool(CONCURRENCY, projects, async project => {
const branches = await api.getBranchesForProject(project.id);
// extract issue number from branch
projectBranches[project.id] = branches
.map(branch => {
return branch.name.split('-')[0];
})
.filter(branchNameStart => {
return branchNameStart.match(/^[0-9]+$/);
})
.map(branchNameStart => {
return Number.parseInt(branchNameStart, 10);
});
});
return projectBranches;
}
/**
* Get issues grouped by assignees
*
* @param api GitLab API to make requests with
* @param label Label to generate report for
*/
export async function getIssuesGroupedByAssignees(api: Api, label: string): Promise<AssigneeWithIssues[]> {
const issuesByAssignee: IssuesGroupedByAssigneeId = {};
const groups = flatten2dArray(
await asyncPool(CONCURRENCY, GROUPS, async groupId => {
const subGroups = await api.getSubGroupsForGroup(groupId);
return subGroups.map(group => {
return group.id;
});
}),
);
groups.push(...groups, ...GROUPS);
const [issues, projects] = await Promise.all([getIssues(api, label, groups), getProjects(api, groups)]);
const issueBranches = await getIssueBranches(api, projects);
const mergeRequests = await getMergeRequests(api, projects);
for (const issue of issues) {
if (issue.assignee === null) {
Logger.warn('Issue without assignee!', issue.web_url);
continue;
}
if (typeof issuesByAssignee[issue.assignee.id] === 'undefined') {
issuesByAssignee[issue.assignee.id] = {
assignee: issue.assignee,
issueCounts: {
closed: 0,
opened: 0,
},
issues: [],
quota: 0,
};
}
if (issue.state === IssueState.REOPENED) {
issue.state = IssueState.OPENED;
}
const issueMeta = {
$branchExists:
typeof issueBranches[issue.project_id] !== 'undefined' &&
issueBranches[issue.project_id].includes(issue.iid),
$closed: issue.state === IssueState.CLOSED,
$issue: issue,
$labels: issue.labels.map((issueLabel: string) => {
return {
bold: BOLD_LABELS.includes(issueLabel),
label: issueLabel,
};
}),
$mergeRequestUrl: getMergeRequestUrls(mergeRequests, issue.project_id, issue.iid)[0],
$project: issue.web_url.replace('https://gitlab.com/', '').split('/-/issues/')[0],
$weeksOpen: moment().diff(moment(issue.created_at), 'weeks'),
};
const issueWithMeta: IssueWithMeta = {
...issue,
...issueMeta,
};
if (issueStateIsOpenedOrClosed(issue.state)) {
issuesByAssignee[issue.assignee.id].issueCounts[issue.state]++;
issuesByAssignee[issue.assignee.id].issues.push(issueWithMeta);
}
}
// calculate quota
for (const _assigneeId in issuesByAssignee) {
if (!issuesByAssignee.hasOwnProperty(_assigneeId)) {
continue;
}
const assigneeId = Number.parseInt(_assigneeId, 10);
issuesByAssignee[assigneeId].quota = Math.floor(
(issuesByAssignee[assigneeId].issueCounts.closed /
(issuesByAssignee[assigneeId].issueCounts.opened +
// tslint:disable-next-line:no-magic-numbers
issuesByAssignee[assigneeId].issueCounts.closed)) *
100,
);
}
// sort issues by weight of labels and status
for (const _assigneeId in issuesByAssignee) {
if (!issuesByAssignee.hasOwnProperty(_assigneeId)) {
continue;
}
const assigneeId = Number.parseInt(_assigneeId, 10);
issuesByAssignee[assigneeId].issues.sort((a, b) => {
let weightA = 0;
let weightB = 0;
for (const issueLabel in LABEL_WEIGHTS) {
if (!LABEL_WEIGHTS.hasOwnProperty(issueLabel)) {
continue;
}
if (a.labels.includes(issueLabel)) {
weightA += LABEL_WEIGHTS[issueLabel];
}
if (b.labels.includes(issueLabel)) {
weightB += LABEL_WEIGHTS[issueLabel];
}
}
if (a.state === IssueState.CLOSED) {
// tslint:disable-next-line:no-magic-numbers
weightA -= 10;
}
if (b.state === IssueState.CLOSED) {
// tslint:disable-next-line:no-magic-numbers
weightB -= 10;
}
return weightB - weightA;
});
}
return Object.values(issuesByAssignee);
}
/**
* Get next meeting day
*/
export function getNextMeetingDay() {
const meetingDay = NEXT_MEETING.format('YYYY-MM-DD');
// log found meeting day
Logger.info(`Generating report for '${meetingDay}' of '${GROUPS.length}' group(s)...`);
return meetingDay;
}
/**
* Get a list of merge requests for projects
*
* @param api GitLab API to make requests with
* @param projects List of projects
*/
export async function getMergeRequests(api: Api, projects: Project[]): Promise<MergeRequestsForProjects> {
const projectMergeRequests: MergeRequestsForProjects = {};
// iterate over projects
await asyncPool(CONCURRENCY, projects, async project => {
// check if project can have merge requests
if (!project.merge_requests_enabled) {
return;
}
// get all merge requests for project
const mergeRequests = await api.getMergeRequests(
MembershipScope.PROJECTS,
project.id,
MergeRequestState.OPENED,
);
// extract issue number from merge request
projectMergeRequests[project.id] = mergeRequests
.map(mergeRequest => {
// keep information about web url too
return {issue_iid: mergeRequest.source_branch.split('-')[0], web_url: mergeRequest.web_url};
})
.filter(branchNameStartAndUrl => {
return branchNameStartAndUrl.issue_iid.match(/^[0-9]+$/);
})
.map(branchNameStartAndUrl => {
return {
issue_iid: Number.parseInt(branchNameStartAndUrl.issue_iid, 10),
web_url: branchNameStartAndUrl.web_url,
};
});
});
return projectMergeRequests;
}
/**
* Generate a report
*
* @param api GitLab API to make requests with
* @param label Label to generate report for
* @param template Template to generate report with
*/
export async function generateReport(api: Api, label: string, template: string): Promise<string> {
const issuesGroupedByAssignee = await getIssuesGroupedByAssignees(api, label);
const structureForTemplate: StructureForTemplate = {
issuesByAssignee: issuesGroupedByAssignee,
meetingDay: getNextMeetingDay(),
timestamp: moment().format('LLL'),
};
return render(template, structureForTemplate);
}
/**
* Generate a markdown report
*
* @param api GitLab API to make requests with
* @param label Label to generate report for
*/
export async function report(api: Api, label: string) {
const meetingDay = getNextMeetingDay();
const readReportFile = await readFilePromisified(
// eslint-disable-next-line unicorn/prefer-module
path.resolve(__dirname, '..', '..', 'templates', 'report.md.mustache'),
);
const markdown = await generateReport(api, label, readReportFile.toString());
let filename = path.join(cwd(), 'reports', `${meetingDay}.md`);
if (label !== 'meeting') {
filename = path.join(cwd(), 'reports', `${label}.md`);
}
await writeFilePromisified(filename, markdown);
Logger.ok(`Wrote file '${filename}'.`);
}

View File

@@ -0,0 +1,436 @@
/*
* Copyright (C) 2018-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {asyncPool} from '@krlwlfrt/async-pool';
import {Api} from '@openstapps/gitlab-api';
import {
AccessLevel,
IssueState,
MembershipScope,
MergeRequestState,
Milestone,
Project,
Scope,
} from '@openstapps/gitlab-api/lib/types';
import {Logger} from '@openstapps/logger';
import {flatten2dArray, getProjects} from '../common';
import {
CONCURRENCY,
GROUPS,
NEEDED_LABELS,
NEEDED_MILESTONES,
NOTE_PREFIX,
PROTECTED_BRANCHES,
SCHOOLS,
} from '../configuration';
/**
* Tidy issues without milestone
*
* This will set the milestone of issues without milestone to 'Meeting'.
*
* @param api GitLab API instance to use for the requests
*/
export async function tidyIssuesWithoutMilestone(api: Api): Promise<void> {
// fetch issues without milestone from all groups
const issueResults = await asyncPool(CONCURRENCY, GROUPS, async groupId => {
return api.getIssues({
groupId: groupId,
milestone: 'No Milestone',
state: IssueState.OPENED,
});
});
// flatten structure, e.g. put all issues in one array
const issuesWithoutMilestone = flatten2dArray(issueResults);
Logger.info(`Found '${issuesWithoutMilestone.length}' issue(s) without milestone.`);
const milestoneCache: {[s: number]: Milestone[]} = {};
await asyncPool(CONCURRENCY, issuesWithoutMilestone, async issue => {
if (typeof milestoneCache[issue.project_id] === 'undefined') {
milestoneCache[issue.project_id] = await api.getMilestonesForProject(issue.project_id);
}
let milestoneId;
for (const milestone of milestoneCache[issue.project_id]) {
if (milestone.title === 'Meeting') {
milestoneId = milestone.id;
}
}
if (typeof milestoneId === 'undefined') {
Logger.warn(`Milestone 'Meeting' was not available for issue ${issue.title} (${issue.web_url}).`);
return;
}
await api.setMilestoneForIssue(issue, milestoneId);
Logger.log(`Milestone was set to 'Meeting' for issue ${issue.title} (${issue.web_url})`);
await api.createNote(
issue.project_id,
Scope.ISSUES,
issue.iid,
`${NOTE_PREFIX} Milestone was set automatically to 'Meeting'.`,
);
});
Logger.ok('Tidied issues without milestones.');
}
/**
* Tidy open issues without meeting label
*
* This adds the label 'meeting' to all open issues that do not have this label.
*
* @param api GitLab API instante to use for requests
*/
export async function tidyOpenIssuesWithoutMeetingLabel(api: Api): Promise<void> {
// fetch all open issues
const issueResults = await asyncPool(CONCURRENCY, GROUPS, async groupId => {
return api.getIssues({
groupId: groupId,
state: IssueState.OPENED,
});
});
// flatten structure, e.g. put all issues in one array
const openIssues = flatten2dArray(issueResults);
Logger.info(`Found ${openIssues.length} open issue(s).`);
// filter issues without meeting label
const openIssuesWithoutMeetingLabel = openIssues.filter(openIssue => {
return !openIssue.labels.includes('meeting');
});
Logger.info(`Filtered ${openIssuesWithoutMeetingLabel.length} open issue(s) without label 'meeting'.`);
await asyncPool(CONCURRENCY, openIssuesWithoutMeetingLabel, async issue => {
if (issue.milestone !== null && issue.milestone.title === 'Backlog') {
Logger.info(`Skipping issue "${issue.title}" because it is in backlog.`);
return;
}
return api.createNote(
issue.project_id,
Scope.ISSUES,
issue.iid,
`${NOTE_PREFIX} Automatically adding label 'meeting'\n\n/label ~meeting`,
);
});
Logger.ok(`Tidied open issues without label 'meeting'.`);
}
/**
* Tidy labels in a list of projects
*
* @param api GitLab API instance to use for the requests
* @param projects List of projects to tidy labels on
*/
export async function tidyLabels(api: Api, projects: Project[]): Promise<void> {
await asyncPool(CONCURRENCY, projects, async project => {
const labels = await api.getLabels(project.id);
const neededLabels = [...NEEDED_LABELS];
// const extraneousLabels: Label[] = [];
for (const label of labels) {
// let needed = false;
for (const [neededLabelIndex, neededLabel] of neededLabels.entries()) {
if (neededLabel.name.toLowerCase() === label.name.toLowerCase()) {
neededLabels.splice(neededLabelIndex, 1);
// needed = true;
}
}
/* if (!needed) {
extraneousLabels.push(label);
} */
}
await asyncPool(CONCURRENCY, neededLabels, async neededLabel => {
await api.createLabel(project.id, neededLabel.name, neededLabel.description, neededLabel.color);
Logger.log(`Created label '${neededLabel.name}' in '${project.name_with_namespace}'.`);
});
// await asyncPool(2, extraneousLabels, async (extraneousLabel) => {
// await api.deleteLabel(project.id, extraneousLabel.name);
//
// Logger.log('Deleted label `' + extraneousLabel.name + '` from ' + project.name_with_namespace + '.');
// });
});
Logger.ok('Tidied labels.');
}
/**
* Tidy milestones in a list of projects
*
* @param api GitLab API instance to use for the requests
* @param projects List of projects to tidy milestones on
*/
export async function tidyMilestones(api: Api, projects: Project[]): Promise<void> {
await asyncPool(CONCURRENCY, projects, async project => {
const milestones = await api.getMilestonesForProject(project.id);
const missingMilestones = [...NEEDED_MILESTONES];
for (const milestone of milestones) {
const index = missingMilestones.indexOf(milestone.title);
if (index >= 0) {
missingMilestones.splice(index, 1);
}
}
if (missingMilestones.length > 0 && !project.archived) {
await asyncPool(CONCURRENCY, missingMilestones, async milestone => {
await api.createMilestone(project.id, milestone);
Logger.log(`Created milestone '${milestone}' for project ${project.name_with_namespace}'.`);
});
}
});
Logger.ok('Tidied milestones.');
}
/**
* Tidy protected branches in a list of projects
*
* @param api GitLab API instance to use for the requests
* @param projects List of projects to tidy milestones on
*/
export async function tidyProtectedBranches(api: Api, projects: Project[]): Promise<void> {
await asyncPool(CONCURRENCY, projects, async project => {
const branches = await api.getBranchesForProject(project.id);
const protectableBranches = branches.filter(branch => {
return PROTECTED_BRANCHES.includes(branch.name);
});
const unprotectedBranches = protectableBranches.filter(branch => {
return !branch.protected;
});
await asyncPool(CONCURRENCY, unprotectedBranches, async branch => {
await api.protectBranch(project.id, branch.name);
Logger.log(`Added protected branch '${branch.name}' in project '${project.name_with_namespace}'...`);
});
});
Logger.ok('Tidied protected branches.');
}
/**
* Tidy protected tags
*
* @param api GitLab API instance to use for the requests
* @param projects List of projects to tidy protected tags on
*/
export async function tidyProtectedTags(api: Api, projects: Project[]): Promise<void> {
await asyncPool(CONCURRENCY, projects, async project => {
// TODO: move this to GitLab API
const protectedTags = (await api.makeGitLabAPIRequest(`projects/${project.id}/protected_tags`)) as Array<{
/**
* List of access levels to create a tag
*/
create_access_levels: Array<{
/**
* Access level
*/
access_level: AccessLevel;
/**
* Description of access level
*/
access_level_description: string;
}>;
/**
* Name of the tag
*/
name: string;
}>;
if (
protectedTags.findIndex(protectedTag => {
return protectedTag.name === 'v*';
}) === -1
) {
await api.makeGitLabAPIRequest(`projects/${project.id}/protected_tags`, {
data: {
create_access_level: AccessLevel.Maintainer,
name: 'v*',
},
method: 'POST',
});
Logger.log(`Added protected version tag in project '${project.name_with_namespace}'.`);
}
});
Logger.ok('Tidied protected tags.');
}
/**
* Tidy "sub" group members
*
* @param api GitLab API instance to use for the requests
*/
export async function tidySubGroupMembers(api: Api): Promise<void> {
const stappsMembers = await api.getMembers(MembershipScope.GROUPS, GROUPS[0]);
const stappsMemberIds = new Set(stappsMembers.map(member => member.id));
const groupIdsToSchool: {[id: number]: string} = {};
Object.keys(SCHOOLS).map(school => {
groupIdsToSchool[SCHOOLS[school]] = school;
});
await asyncPool(CONCURRENCY, GROUPS.slice(1), async groupId => {
const members = await api.getMembers(MembershipScope.GROUPS, groupId);
const memberIds = new Set(members.map(member => member.id));
await asyncPool(CONCURRENCY, stappsMembers, async stappsMember => {
if (!memberIds.has(stappsMember.id)) {
await api.addMember(MembershipScope.GROUPS, groupId, stappsMember.id, AccessLevel.Developer);
Logger.log(`Added '${stappsMember.name}' to group '${groupIdsToSchool[groupId]}'.`);
}
});
await asyncPool(CONCURRENCY, members, async member => {
if (!stappsMemberIds.has(member.id)) {
await api.deleteMember(MembershipScope.GROUPS, groupId, member.id);
Logger.log(`Deleted member '${member.name}' from group '${groupIdsToSchool[groupId]}'.`);
}
});
});
Logger.ok(`Tidied 'sub' group members.`);
}
/**
* Tidy issues without assignee
*
* Set assignee to author if no assignee is set.
*
* @param api GitLab API instance to use for the requests
*/
export async function tidyIssuesWithoutAssignee(api: Api): Promise<void> {
// fetch issues without milestone from all groups
const issueResults = await asyncPool(CONCURRENCY, GROUPS, async groupId => {
return api.getIssues({
groupId: groupId,
state: IssueState.OPENED,
});
});
// flatten structure, e.g. put all issues in one array
const issues = flatten2dArray(issueResults);
const issuesWithoutAssignee = issues.filter(issue => {
return issue.assignee === null;
});
Logger.info(`Found '${issuesWithoutAssignee.length}' issue(s) without assignee.`);
await asyncPool(CONCURRENCY, issuesWithoutAssignee, async issue => {
await api.setAssigneeForIssue(issue, issue.author.id);
Logger.log(`Set assignee for '${issue.title}' to '${issue.author.name}'.`);
await api.createNote(
issue.project_id,
Scope.ISSUES,
issue.iid,
`${NOTE_PREFIX} Assignee was set automatically to author.`,
);
});
Logger.ok('Tidied issues without assignee.');
}
/**
* Tidy merge requests without assignee
*
* Set assignee to author if no assignee is set.
*
* @param api GitLab API instance to use for the requests
*/
export async function tidyMergeRequestsWithoutAssignee(api: Api): Promise<void> {
const mergeRequestResults = await asyncPool(CONCURRENCY, GROUPS, async groupId => {
return api.getMergeRequests(MembershipScope.GROUPS, groupId, MergeRequestState.OPENED);
});
// flatten structure, e.g. put all issues in one array
const mergeRequests = flatten2dArray(mergeRequestResults);
const mergeRequestsWithoutAssignee = mergeRequests.filter(mergeRequest => {
return mergeRequest.assignee === null;
});
Logger.info(`Found '${mergeRequestsWithoutAssignee.length}' merge requests without assignee.`);
await asyncPool(CONCURRENCY, mergeRequestsWithoutAssignee, async mergeRequest => {
await api.setAssigneeForMergeRequest(mergeRequest, mergeRequest.author.id);
Logger.log(`Set assignee for '${mergeRequest.title}' to '${mergeRequest.author.name}'.`);
await api.createNote(
mergeRequest.project_id,
Scope.MERGE_REQUESTS,
mergeRequest.iid,
`${NOTE_PREFIX} Assignee was set automatically to author.`,
);
});
Logger.ok('Tidied merge requests without assignee.');
}
/**
* Tidy
*
* @param api GitLab API instance to use for the requests
*/
export async function tidy(api: Api) {
// get first level sub groups
const groups = [...GROUPS];
const subGroups = await api.getSubGroupsForGroup(groups[0]);
groups.push(...groups, ...subGroups.map(group => group.id));
// get non archived projects of groups
let projects = await getProjects(api, groups);
projects = projects.filter(project => !project.archived);
await Promise.all([
// Labels are now specified at Group level
// await tidyLabels(api, projects),
await tidyMilestones(api, projects),
await tidyProtectedBranches(api, projects),
await tidyProtectedTags(api, projects),
]);
await tidyOpenIssuesWithoutMeetingLabel(api);
await tidyIssuesWithoutAssignee(api);
await tidyMergeRequestsWithoutAssignee(api);
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) 2018-2022 Open StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {asyncPool} from '@krlwlfrt/async-pool';
import {Api} from '@openstapps/gitlab-api';
import {IssueState, Scope} from '@openstapps/gitlab-api/lib/types';
import {Logger} from '@openstapps/logger';
import moment from 'moment';
import {flatten2dArray} from '../common';
import {CONCURRENCY, GROUPS, LAST_MEETING, NOTE_PREFIX} from '../configuration';
/**
* Remove label `meeting` from closed issues
*
* @param api Instance of GitLabAPI to send requests with
*/
export async function unlabel(api: Api) {
const issueResults = await asyncPool(CONCURRENCY, GROUPS, async groupId => {
return api.getIssues({
groupId: groupId,
state: IssueState.CLOSED,
});
});
const issues = flatten2dArray(issueResults);
Logger.log(`Fetched ${issues.length} closed issue(s).`);
await asyncPool(CONCURRENCY, issues, async issue => {
if (
issue.labels.includes('meeting') &&
issue.closed_at !== null &&
moment(issue.closed_at).isBefore(LAST_MEETING)
) {
Logger.info(`Issue ${issue.title} is closed before last meeting and has label "meeting". Removing it.`);
await api.createNote(
issue.project_id,
Scope.ISSUES,
issue.iid,
`${NOTE_PREFIX} Removed label \`meeting\` automatically.
/unlabel ~meeting`,
);
}
});
Logger.ok('Label `meeting` has been removed from closed issues.');
}

View File

@@ -0,0 +1,16 @@
# Meeting {{meetingDay}}
{{#issuesByAssignee}}
## {{#assignee.avatar_url}}<img src="{{&assignee.avatar_url}}" height="30" alt="{{assignee.name}}"/> {{/assignee.avatar_url}}{{assignee.name}}
### open: {{issueCounts.opened}}, closed: {{issueCounts.closed}}
quota closed: {{quota}}%
| __title__ | __status__ | __project__ | __weeks__ |
| --- | --- | --- | --- |
{{#issues}}| __[{{#$closed}}~~{{title}}~~{{/$closed}}{{^$closed}}{{title}}{{/$closed}}]({{&web_url}})__<br />__Labels:__{{#$labels}}{{#bold}} __{{label}}__ {{/bold}}{{^bold}} {{label}} {{/bold}}{{/$labels}} | {{#$branchExists}}<img src="https://cdn0.iconfinder.com/data/icons/octicons/1024/git-branch-512.png" height="30" alt="branch exists"/>{{/$branchExists}}{{#$mergeRequestUrl}}[<img src="https://cdn0.iconfinder.com/data/icons/octicons/1024/git-merge-512.png" height="30" alt="merge request exists"/>]({{&$mergeRequestUrl}}){{/$mergeRequestUrl}} | [{{$project}}](https://gitlab.com/{{&$project}}) | {{$weeksOpen}} |
{{/issues}}
{{/issuesByAssignee}}
Generated {{timestamp}}.

View File

@@ -0,0 +1,43 @@
import * as chai from 'chai';
import {expect} from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {execSync} from 'child_process';
import {suite, test} from '@testdeck/mocha';
import {join} from 'path';
import {dirSync} from 'tmp';
import {getUsedVersion, getUsedVersionMajorMinor} from '../src/tasks/get-used-version';
chai.use(chaiAsPromised);
chai.should();
@suite()
export class GetUsedVersionsSpec {
@test
async 'does not depend on core'() {
return getUsedVersion(join(__dirname, '..'), '@openstapps/core').should.eventually.be.rejected;
}
@test
async 'not a Node.js project'() {
return getUsedVersion(__dirname, '@openstapps/core').should.eventually.be.rejected;
}
@test
async 'has no dependencies'() {
const temporaryDirectory = dirSync();
execSync(`cd ${temporaryDirectory.name}; npm init -y`);
await getUsedVersion(temporaryDirectory.name, '@openstapps/core').should.eventually.be.rejected;
}
@test
async 'get used version'() {
expect(await getUsedVersion(join(__dirname, '..'), '@krlwlfrt/async-pool')).to.be.equal('0.4.1');
}
@test
async 'get used version major minor'() {
expect(await getUsedVersionMajorMinor(join(__dirname, '..'), '@krlwlfrt/async-pool')).to.be.equal('0.4');
}
}

View File

@@ -0,0 +1,3 @@
{
"extends": "./node_modules/@openstapps/configuration/tsconfig.json"
}