Skip to content

Commit

Permalink
Merge pull request #1 from OpenRailAssociation/docs-and-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmehl authored Feb 28, 2025
2 parents 2a3a605 + 959143a commit 187590a
Show file tree
Hide file tree
Showing 23 changed files with 1,088 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/actions/poetrybuild/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2025 DB Systel GmbH
#
# SPDX-License-Identifier: Apache-2.0

name: "Reusable Poetry build workflow"
inputs:
python:
default: "3.10"
description: "Value for 'python-version'"
required: false
type: string
poetry_args:
default: ""
description: "Additional arguments for the poetry install step'"
required: false
type: string
runs:
using: "composite"
steps:
- name: Install poetry
run: pipx install poetry
shell: bash
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction ${{ inputs.poetry_args }}
shell: bash
18 changes: 18 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2025 DB Systel GmbH
#
# SPDX-License-Identifier: Apache-2.0

name: Publish release on PyPI
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and publish to PyPI
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# SPDX-FileCopyrightText: 2025 DB Systel GmbH
#
# SPDX-License-Identifier: Apache-2.0

name: Test suites

on:
push:
branches:
- main
pull_request:

jobs:
# Test using the tool via poetry on different OSes and python versions
test-os-python-matrix:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 10
# do not abort the whole test job if one combination in the matrix fails
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-22.04]
include:
- python-version: "3.10"
os: macos-latest
- python-version: "3.10"
os: windows-latest

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/poetrybuild
with:
python: ${{ matrix.python-version }}
poetry_args: --only main
- name: Execute auth-user-mgr
run: poetry run auth-user-mgr --help

# Test building the package and installing it via pip3
test-build-install:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Build package
run: poetry build
- name: Install package
run: pip3 install dist/authentik_user_manager-*.tar.gz
- name: Run package
run: |
auth-user-mgr --version
auth-user-mgr --help
# Formatting
pylint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/poetrybuild
- name: Lint with pylint
run: poetry run pylint --disable=fixme auth_user_mgr/

formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/poetrybuild
- name: Test formatting with isort and black
run: |
poetry run isort --check auth_user_mgr/
poetry run black --check .
mypy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/poetrybuild
- name: Test typing with mypy
run: poetry run mypy

# REUSE
reuse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check REUSE Compliance
uses: fsfe/reuse-action@v3
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 DB Systel GmbH
#
# SPDX-License-Identifier: Apache-2.0

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
140 changes: 140 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!--
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
SPDX-FileCopyrightText: 2025 DB Systel GmbH
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: CC-BY-4.0
-->

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
SPDX-FileCopyrightText: 2024 DB Systel GmbH
SPDX-FileCopyrightText: 2025 DB Systel GmbH
SPDX-License-Identifier: Apache-2.0
-->

# Contributing to Compliance Assistant

Thank you for your interest in this project. Contributions are welcome. Feel free to open an issue with questions or reporting ideas and bugs, or open pull requests to contribute code.

We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind!

## Development setup

Starting development is as easy as installing Python `poetry` and running `poetry install` once.

In order to run the project in the new virtual environment, run `poetry run auth-user-mgr`.

## Contribution workflow

1. Fork the repository.
2. Create a new branch for your feature or bug fix: `git checkout -b feature-or-fix-name`
3. Make your changes and commit them with descriptive messages.
4. Push your changes to your forked repository: `git push origin feature-or-fix-name`
5. Open a Pull Request on the main repository.

It is assumed that you contribute under the [main license](LICENSE) of the project and own all the rights to the content you submit.
50 changes: 50 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
SPDX-FileCopyrightText: 2024 GitHub, Inc.
SPDX-FileCopyrightText: 2025 DB Systel GmbH
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: CC-BY-4.0
-->

# Governance Policy

This document provides the governance policy for the Project. Maintainers agree to this policy and to abide by all Project policies, including the [code of conduct](./CODE-OF-CONDUCT.md) by adding their name to the [`MAINTAINERS.md` file](./MAINTAINERS.md).

## 1. Roles.

This project may include the following roles. Additional roles may be adopted and documented by the Project.

**1.1. Maintainers**. Maintainers are responsible for organizing activities around developing, maintaining, and updating the Project. Maintainers are also responsible for determining consensus. This Project may add or remove Maintainers with the approval of the current Maintainers.

**1.2. Contributors**. Contributors are those that have made contributions to the Project.

## 2. Decisions.

*Projects may adopt their own decision making process. It has to be documented in this section of the governance document. The template defines the default decision making process as recommendation.*

**2.1. Consensus-Based Decision Making**. Projects make decisions through consensus of the Maintainers. While explicit agreement of all Maintainers is preferred, it is not required for consensus. Rather, the Maintainers will determine consensus based on their good faith consideration of a number of factors, including the dominant view of the Contributors and nature of support and objections. The Maintainers will document evidence of consensus in accordance with these requirements.

**2.2. Appeal Process**. Decisions may be appealed by opening an issue and that appeal will be considered by the Maintainers in good faith, who will respond in writing within a reasonable time. If the Maintainers deny the appeal, the appeal may be brought before the Technical Committee, who will also respond in writing in a reasonable time.

## 3. How We Work.

**3.1. Openness**. Participation is open to anyone who is directly and materially affected by the activity in question. There shall be no undue financial barriers to participation.

**3.2. Balance**. The development process should balance the interests of Contributors and other stakeholders. Contributors from diverse interest categories shall be sought with the objective of achieving balance.

**3.3. Coordination and Harmonization**. Good faith efforts shall be made to resolve potential conflicts or incompatibility between releases in this Project.

**3.4. Consideration of Views and Objections**. Prompt consideration shall be given to the written views and objections of all Contributors.

**3.5. Written procedures**. This governance document and other materials documenting this project's development process shall be available to any interested person.

## 4. No Confidentiality.

Information disclosed in connection with any Project activity, including but not limited to meetings, contributions, and submissions, is not confidential, regardless of any markings or statements to the contrary.

## 5. Amendments.

Amendments to this governance policy may be made by affirmative vote of 2/3 of all Maintainers, with approval by the Technical Committee.

---
Based on [GitHub's Minimum Viable Governance (MVG)](https://github.com/github/MVG). Licensed under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by/4.0/).
Loading

0 comments on commit 187590a

Please sign in to comment.