diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7e09d5f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# These owners will be the default owners for everything in the repo. +# Unless a later match takes precedence, global owners will be requested for review when someone opens a pull request. +* @SchweizerischeBundesbahnen/SBB-CLEW-POLARION-ADMINS @SchweizerischeBundesbahnen/SBB-CLEW-POLARION-MAINTAINERS diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..0a9e135 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,56 @@ +--- +name: Bug report +description: File a new bug +labels: [bug, triage] +body: + - type: markdown + attributes: + value: | + Before requesting: search [existing issues](../../../../labels/bug). + - type: textarea + attributes: + label: Current Behavior + description: Description of the current behavior. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: Description of the expected behavior. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: 'Example steps to reproduce the behavior:' + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + - type: input + attributes: + label: Environment - OS + description: Linux or Windows + validations: + required: true + - type: input + attributes: + label: Polarion version + description: 2310, 2404, etc... + validations: + required: true + - type: input + attributes: + label: Extension Version + description: It can be found under https://<>/polarion/#/project/dev/administration/<>/About + validations: + required: true + - type: textarea + attributes: + label: Anything else + description: Further hints, links, or references? Any additional information probably helping in root cause analysis. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..216f9c3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,29 @@ +--- +name: Feature request +description: Request an enhancement for this Polarion extension +labels: [enhancement] +body: + - type: markdown + attributes: + value: | + Before requesting: search [existing issues](../../../../labels/enhancement). + - type: textarea + attributes: + label: Description + description: Describe the feature you're requesting. + placeholder: This feature adds functionality to ... + validations: + required: true + - type: textarea + attributes: + label: Motivation + description: Describe additional context such as examples or use cases helping in understanding the feature request. + placeholder: 'This feature would be helpful because ... so that the following use case is addressed: ...' + validations: + required: true + - type: textarea + attributes: + label: Proposed Solution (optional) + description: Sketch an implementation idea, possibly considering multiple approaches. + validations: + required: false diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..783b685 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +### Proposed changes + +Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the [supported keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) here in this description (not in the title of the PR). + +### Checklist + +Before creating a PR, run through this checklist and mark each as complete: +- [ ] I have read the [`CONTRIBUTING`](CONTRIBUTING.md) document +- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works +- [ ] If applicable, I have checked that any relevant tests pass after adding my changes +- [ ] I have updated any relevant documentation diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml new file mode 100644 index 0000000..8e6ab4f --- /dev/null +++ b/.github/workflows/maven-release.yml @@ -0,0 +1,83 @@ +--- +name: maven-release +on: + push: + branches: ['**/**'] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - name: Set up JDK and Maven + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4 + with: + distribution: adopt + java-version: 17 + cache: maven + gpg-private-key: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PRIVATE_KEY }} + - uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22 + with: + repositories: > + [ + { + "id": "s3", + "name": "s3.sbb.polarion.maven.repo", + "url": "s3://sbb-polarion-maven-repo/polarion.mvn", + "releases": { + "enabled": "true", + "updatePolicy": "never" + } + } + ] + servers: > + [ + { + "id": "s3", + "username": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_ACCESS_KEY }}", + "password": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_SECRET_ACCESS_KEY }}" + }, + { + "id": "github", + "username": "${env.GITHUB_ACTOR}", + "password": "${env.GITHUB_TOKEN}" + }, + { + "id": "ossrh", + "username": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_USERNAME }}", + "password": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_TOKEN }}" + }, + { + "id": "gpg.passphrase", + "passphrase": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}" + } + ] + profiles: > + [ + { + "id": "deploy-github-packages", + "properties": + { + "altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}" + } + } + ] + - name: Print settings.xml + run: cat /home/runner/.m2/settings.xml + - name: Build with Maven + run: mvn --batch-mode clean package + env: + FAIL_ON_CHECK_COMMANDS: 'true' + - name: Extract artefact version + id: artefact_version + run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT + - name: Publish to Maven Central + if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} + run: mvn --batch-mode deploy -P gpg-sign -P nexus-staging + - name: Publish to GitHub Packages + if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} + run: mvn --batch-mode deploy -P gpg-sign -P deploy-github-packages + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..261ac00 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,23 @@ +--- +name: PR checks +on: + pull_request: + types: [opened, edited, synchronize, reopened, unlocked] +permissions: + contents: read +jobs: + check-conventional-commit: + name: Check commit messages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 + with: + cache: pip # caching pip dependencies + - run: pip install commitizen + - name: Check commit messages + run: cz check --rev-range origin/${GITHUB_BASE_REF}.. diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..32c85a1 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +--- +name: release-please +on: + push: + branches: [main] +permissions: + contents: write + pull-requests: write +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - name: release-please + id: release + uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4 + with: + release-type: maven + target-branch: main diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..523d664 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* +.idea/* + +# code style config +!.idea/codeStyles +.idea/codeStyles/* +!.idea/codeStyles/Project.xml +!.idea/codeStyles/codeStyleConfig.xml + +.vscode/* + +target/ +*.iml +dependency-reduced-pom.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..b8c83cc --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 0000000..4d1f8b9 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,7 @@ + + + com.github.seahen + maven-s3-wagon + 1.3.3 + + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a79835b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +--- +default_install_hook_types: [pre-commit, commit-msg] +repos: + - repo: https://github.com/lyz-code/yamlfix + rev: 1.16.0 + hooks: + - id: yamlfix + args: [-c, .yamlfix.toml] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-merge-conflict + - id: trailing-whitespace + - id: check-xml + - id: check-json + - id: check-yaml + - id: no-commit-to-branch + - id: mixed-line-ending + - repo: https://github.com/zricethezav/gitleaks + rev: v8.18.4 + hooks: + - id: gitleaks + - repo: https://github.com/grigoriev/pre-commit-check-git-user + rev: v0.9.0 + hooks: + - id: check-git-config-user-email + args: [--templates, ^\S+\.\S+@sbb\.ch$] + - repo: https://github.com/commitizen-tools/commitizen + rev: v3.27.0 + hooks: + - id: commitizen diff --git a/.yamlfix.toml b/.yamlfix.toml new file mode 100644 index 0000000..4d8e209 --- /dev/null +++ b/.yamlfix.toml @@ -0,0 +1,3 @@ +allow_duplicate_keys = false +line_length = 180 +sequence_style = "flow_style" \ No newline at end of file diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md new file mode 100644 index 0000000..542cdf7 --- /dev/null +++ b/CODING_STANDARDS.md @@ -0,0 +1,88 @@ +# Repository Coding Standards + +The purpose of the Coding Standards is to create a baseline for collaboration and review within various aspects of our open source project and community, from core code to themes to plugins. + +Coding standards help avoid common coding errors, improve the readability of code, and simplify modification. They ensure that files within the project appear as if they were created by a single common unit. + +Following the standards means anyone will be able to understand a section of code and modify it, if needed, without regard to when it was written or by whom. + +If you are planning to contribute, you need to familiarize yourself with these standards, as any code you submit will need to comply with them. + +## Java Coding Standards and Best Practices + +This document outlines the coding standards and best practices to be followed when writing Java code for this project. Consistency in coding style and adherence to best practices not only improve code readability but also facilitate collaboration and maintenance. + +### Coding Standards Guidelines + +Please refer to the following coding standards guidelines for detailed recommendations: + +1. [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html) - Google's Java style guide offers comprehensive guidelines on coding style, naming conventions, documentation, and more. + +2. [Oracle's Java Code Conventions](https://www.oracle.com/java/technologies/javase/codeconventions-contents.html) - Oracle provides a set of conventions for writing Java code, covering formatting, naming conventions, and other aspects of coding style. + +### Linters + +We recommend using the following linters to enforce coding standards and best practices in your Java code: + +1. [Checkstyle](https://checkstyle.org/) - Checkstyle is a static code analysis tool that checks Java code against a set of coding standards. It can detect violations of coding conventions, potential bugs, and other code quality issues. + +2. [FindBugs](http://findbugs.sourceforge.net/) - FindBugs is a static analysis tool that detects potential bugs in Java code. It can identify common programming errors, performance issues, and security vulnerabilities. + +3. [PMD](https://pmd.github.io/) - PMD is a source code analyzer that finds common programming flaws like unused variables, empty catch blocks, and unnecessary object creation. It provides actionable feedback to improve code quality. + +4. [SpotBugs](https://spotbugs.github.io/) - SpotBugs is the successor of FindBugs, offering more features and improved bug detection capabilities. It performs static analysis to identify bugs and other issues in Java bytecode. + +## Python Coding Standards and Best Practices + +This document outlines the coding standards and best practices to be followed when writing Python code for this project. Consistency in coding style and adherence to best practices not only improve code readability but also facilitate collaboration and maintenance. + +### Coding Standards Guidelines + +Please refer to the following coding standards guidelines for detailed recommendations: + +1. [PEP 8](https://pep8.org/) - Python Enhancement Proposal 8 provides the de facto style guide for Python code, covering formatting, naming conventions, and more. + +2. [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) - Google's Python style guide offers comprehensive guidelines on coding style, naming conventions, documentation, and more. + +### Linters + +We recommend using the following linters to enforce coding standards and best practices in your Python code: + +1. [flake8](https://flake8.pycqa.org/en/latest/) - Flake8 combines multiple linters including pycodestyle, pyflakes, and McCabe complexity checker to analyze your code against the PEP 8 style guide and detect various errors and inconsistencies. + +2. [pylint](https://pylint.pycqa.org/) - Pylint analyzes Python code for errors, potential bugs, and code smells, providing detailed reports with suggestions for improvement. + +3. [black](https://black.readthedocs.io/en/stable/) - Black is an opinionated code formatter for Python that automatically reformats your code to ensure consistent style adherence. + +4. [mypy](http://mypy-lang.org/) - Mypy is a static type checker for Python that helps detect and prevent type-related errors using optional static typing. + + +## Docker Best Practices and Guidelines + +This document outlines the best practices and guidelines to be followed when working with Docker for this project. Adhering to these practices ensures consistency, security, and efficiency in Dockerfile and container management. + +### Best Practices Guidelines + +Please refer to the following best practices guidelines for detailed recommendations: + +1. [Docker Official Best Practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) - Docker's official documentation provides a comprehensive guide on best practices for writing Dockerfiles. It covers various aspects including image size optimization, layer caching, and security considerations. + +2. [Google Container Best Practices](https://cloud.google.com/solutions/best-practices-for-building-containers) - Google Cloud offers best practices for building and deploying containers, covering topics like image security, resource optimization, and container orchestration. + +3. [Red Hat Container Best Practices](https://www.redhat.com/en/topics/containers/container-best-practices) - Red Hat provides best practices for building and managing containers, focusing on security, performance, and scalability aspects. + +4. [Microsoft Dockerfile best practices](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/docker-application-development-process/docker-app-development-workflow) - Microsoft offers best practices for Dockerfile development, including multi-stage builds, image tagging, and Docker Compose usage. + +### Linters and Static Analysis Tools + +While Dockerfiles are not typically linted like source code, you can use static analysis tools to ensure adherence to best practices and detect potential issues: + +1. [Hadolint](https://github.com/hadolint/hadolint) - Hadolint is a Dockerfile linter that checks Dockerfiles for common mistakes and best practices violations. It provides suggestions for improving Dockerfile quality and security. + +2. [Docker Bench for Security](https://github.com/docker/docker-bench-security) - Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production. + +3. [Trivy](https://github.com/aquasecurity/trivy) - Trivy is a vulnerability scanner for containers and other artifacts, providing detailed reports on security vulnerabilities in Docker images. + +--- + +This setup provides both the high-level guidelines for coding standards and best practices, as well as practical tools (linters) that can be used to enforce these standards in your project. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fbeaf36 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,107 @@ +# Contributing +We appreciate all kinds of contributions. The following is a set of guidelines for contributing to this repository on GitHub. +These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Table Of Contents +[Prerequisites](#prerequisites) + +[Asking Questions](#asking-questions) + +[What should I know before I get started?](#what-should-i-know-before-i-get-started) +* [Tools and Packages](#tools-and-packages) +* [Design Decisions](#design-decisions) + +[How Can I Contribute?](#how-can-i-contribute) +* [Reporting Bugs](#reporting-bugs) +* [Suggesting Enhancements](#suggesting-enhancements) +* [Submitting Changes](#submitting-changes) +* [Commit Message Guidelines](#commit-message-guidelines) +* [Coding Rules](#coding-rules) + +## Prerequisites +This project and everyone participating in it are governed by our [Code of Conduct](https://github.com/SchweizerischeBundesbahnen/.github/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. + +All contributors must have an active Polarion license. An active Polarion license means that the contributor has access to a valid Polarion license issued by Siemens, including but not limited to customer, partner, academic, trial, or demo Polarion license. + +## Asking questions +Do not know how something in this project works? Curious if this project can achieve your desired functionality? Please ask questions in this project discussions [here](../../discussions) + +## What should I know before I get started? + +### Tools and Packages +All extensions provided by SBB Polarion Team can be built, tested and packaged using Maven. +It is only possible when the dependencies are extract from Polarion installer. The process must be performed by each contributor. Please consider to use https://github.com/SchweizerischeBundesbahnen/polarion-artifacts-deployer to extract the dependencies for your own Polarion installer version. + +### Design Decisions +The generic implementation for extensions provided by SBB Polarion Team is located in [ch.sbb.polarion.extension.generic](https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic) + +## How Can I Contribute? + +### Reporting Bugs +To report a bug, [submit an issue](../../issues/new) with the label `bug`. Please ensure the bug has not already been reported. **If the bug is a potential security vulnerability, please report it using our [security policy](https://github.com/SchweizerischeBundesbahnen/.github/blob/main/SECURITY.md).** + +Providing the following information will increase the chances of your issue being dealt with quickly: + +* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps +* **Toolchain and Environment Details** - which versions of libraries, toolchain, platform etc +* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you +* **Browsers and Operating System** - is this a problem with all browsers? +* **Reproduce the Error** - provide a live example or a unambiguous set of steps +* **Screenshots** - maybe screenshots can help the team to triage issues far more quickly than a text description +* **Related Issues** - has a similar issue been reported before? +* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit) + +You can help the team even more by [submitting changes](#submitting-changes) with a fix. + +### Suggesting Enhancements +To suggest a feature or enhancement, please [submit an issue](../../issues/new) with the label `enhancement`. Please ensure the feature or enhancement has not already been suggested. + +Please consider what kind of change it is: + +* For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. +* **Small Features** can be crafted and directly [submitted changes](#submitting-changes). + +### Submitting Changes +Before you submit your Pull Request (PR) consider the following guidelines: + +* Make your changes in a new git branch: + + ```shell + git checkout -b my-fix-branch main + ``` + +* Create your patch, **including appropriate test cases**. +* Follow our [Coding Rules](#coding-rules). +* Test your changes with our supported browsers and screen readers. +* Run tests and ensure that all tests pass. +* Commit your changes using a descriptive commit message that follows our + [commit message conventions](#commit-message-guidelines). Adherence to these conventions + is necessary because release notes are automatically generated from these messages. + + ```shell + git commit -a -S + ``` + Note: The optional commit `-a` command line option will automatically "add" and "rm" edited files. + + Note: The command line option `-S` generates a signed commit, which is required to make a contribution (See [Developer Certificate of Origin](./LICENSES/DCO.txt)) + +* Push your branch to GitHub: + + ```shell + git push my-fork my-fix-branch + ``` + +* In GitHub, send a pull request to `sbb-your-project:main`. + The PR title and message should as well conform to the [commit message conventions](#commit-message-guidelines). + +### Commit Message Guidelines +This project uses [Conventional Commits](https://www.conventionalcommits.org/) to generate the Changelog using the [Release Please GitHub action](.github/workflows/release-please.yml). +For comprehensive information, please consult the [Release Please documentation](https://github.com/googleapis/release-please). + +### Coding Rules +To ensure consistency throughout the source code, keep these rules in mind as you are working: + +* All features or bug fixes **must be tested** by one or more specs (unit-tests). +* All API methods **must be documented**. +* Also see [CODING_STANDARDS.md](./CODING_STANDARDS.md) + diff --git a/LICENSES/Apache.txt b/LICENSES/Apache.txt new file mode 100644 index 0000000..c61b663 --- /dev/null +++ b/LICENSES/Apache.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/DCO.txt b/LICENSES/DCO.txt new file mode 100644 index 0000000..49b8cb0 --- /dev/null +++ b/LICENSES/DCO.txt @@ -0,0 +1,34 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/LICENSES/SBB.txt b/LICENSES/SBB.txt new file mode 100644 index 0000000..f1cdf0a --- /dev/null +++ b/LICENSES/SBB.txt @@ -0,0 +1,14 @@ +Copyright 2024 SBB AG and contributors +Version 1.0 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..069a77b --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Polarion ALM extension to <...> + +This Polarion extension provides possibility to <...> +## Build + +This extension can be produced using maven: +```bash +mvn clean package +``` + +## Installation to Polarion + +To install the extension to Polarion `ch.sbb.polarion.extension.-.jar` +should be copied to `/polarion/extensions/ch.sbb.polarion.extension./eclipse/plugins` +It can be done manually or automated using maven build: +```bash +mvn clean install -P install-to-local-polarion +``` +For automated installation with maven env variable `POLARION_HOME` should be defined and point to folder where Polarion is installed. + +Changes only take effect after restart of Polarion. + +## Polarion configuration + +<...> + + +## Extension Configuration + +<...> + + +## Usage + +<...> + diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..63bc60e --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,19 @@ + +# Guidelines for Releases + +## Code Ownership and Automated Release Management + +Releases within our project are exclusively overseen by designated code owners, as outlined in the [/ .github / CODEOWNERS](/.github/CODEOWNERS) file. Our release process is automated using the Release Please GitHub action, which is configured in [/ .github / workflows / release-please.yml](/.github/workflows/release-please.yml). + +## Overview of the Workflow: + +1. For the initial release, the Release Please GitHub action generates a pull request entitled "chore(main): release 1.0.0", marking the commencement of version 1.0.0. This pull request necessitates approval as required. + +2. Following the triumphant launch of the initial version, the action automatically generates another pull request to advance the version to 1.0.1-SNAPSHOT. Prompt approval of this pull request is encouraged post the inaugural release. + +3. Whenever alterations are introduced to the main branch, the Release Please GitHub action dynamically creates or updates the existing pull request, titled "chore(main): release X.Y.Z", where X.Y.Z denotes the version calculated based on Git message history. + +4. Subsequent to each release, the process iterates to update the version to X.Y.Z-SNAPSHOT, thereby preparing a new pull request for the forthcoming X.Y.Z version release. + + +For comprehensive information, please consult the [Release Please documentation](https://github.com/googleapis/release-please). diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7b346c9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + + ch.sbb.polarion.extensions + ch.sbb.polarion.extension.generic + 6.0.2 + + + ch.sbb.polarion.extension.extension-name + 0.0.0-SNAPSHOT + jar + + ... extension of Polarion ALM + This is a Polarion extension which provides ... + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name + + + + The SBB License, Version 1.0 + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name/blob/main/LICENSES/SBB.txt + + + + + + SBB Polarion Team + polarion-opensource@sbb.ch + SBB AG + http://www.sbb.ch + + + + + scm:git:git://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name.git + scm:git:ssh://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name.git + http://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name/tree/main + + + + GitHub + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.extension-name/issues + + + + extension-name + ch.sbb.polarion.extension.extension_name + + ${maven-jar-plugin.Extension-Context} + + + + + ch.sbb.polarion.extensions + ch.sbb.polarion.extension.generic.app + ${project.parent.version} + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + org.jacoco + jacoco-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + org.apache.maven.plugins + maven-source-plugin + + + + diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..959d019 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>SchweizerischeBundesbahnen/casc-renovate-preset-polarion-java" + ] +} diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..e38ad38 --- /dev/null +++ b/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Support-Email: polarion-opensource@sbb.ch +Bundle-Name: Extension for Polarion ALM +Require-Bundle: com.polarion.portal.tomcat, + com.polarion.alm.ui, + com.polarion.platform.guice, + com.polarion.alm.tracker, + org.glassfish.jersey, + com.fasterxml.jackson, + com.fasterxml.jackson.jaxrs, + io.swagger, + org.apache.commons.logging, + slf4j.api, + org.springframework.spring-core, + org.springframework.spring-web