Skip to content

Commit

Permalink
added base documentation and branch protection rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-VM committed Dec 2, 2024
1 parent 09c497d commit 5be0521
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Patho-webcore: Contributing Guidelines

Thank you for considering contributing to the Patho-webcore project! Below, you'll find an outline of how to contribute effectively to our project. Please read through these guidelines before starting.

## Contribution workflow
<!-- Add details about the workflow for contributing, such as creating issues, branching conventions, submitting pull requests, and the review process. -->

## Tests

### Lint tests
<!-- Specify the linting tools used in the project and how contributors should run them (e.g., `flake8`, `black`, etc.). -->

### Code Tests
<!-- Provide instructions on running the project's test suite, including setup steps and commands (e.g., `pytest`). -->

## Version Release
### Check list before releasing a version

- [ ] Ensure all CI/CD tests on the `develop` branch are passing.
- [ ] Address any warnings from automated linters or tools.
- [ ] Update outdated dependencies and verify compatibility.

- [ ] Resolve any outstanding issues, prioritizing bug fixes and critical updates.
- [ ] Review and finalize the description of the repository for release, ensuring any "under `develop`" labels are removed.
- [ ] Close or move unresolved milestone issues to the next version, as needed.

### Steps to release
1. Update the `develop` branch to reflect the release version:
- Example: 1.0.0-develop becomes 1.0.0.
- Use versioning tools to ensure consistent updates across all files and metadata.
2. Validate the release:
- Run tests and ensure no failures occur.
- Confirm CHANGELOG.md includes all relevant updates for the release.
- Add contributors to CHANGELOG.md for improved recognition.
3. Submit a Pull Request (PR):
- Create a PR from your fork to the `develop` branch with the release changes.
- After merging, create another PR from source repo `develop` branch to the `main` branch for final review and approval (2 reviews are required).
4. Publish the release:
- Tag the release version in GitHub (e.g., 1.0.0).
- Include an optional descriptive title or code name for the release.

### After Release

5. Bump the version number for continued `develop`:
- Example: 1.0.0 becomes 1.1.0-develop.
- Update CHANGELOG.md to include a new section for upcoming changes.
62 changes: 62 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Bug report
description: Report an issue or malfunction in the repository
labels: bug
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report an issue! Please ensure you've checked the following before submitting:
- **Read the project documentation**:
- [Repository Documentation](https://your-repo-docs-link-here)
- **Check if this issue has already been reported**:
- Search existing issues in this repository.
- type: textarea
id: description
attributes:
label: Description of the issue
description: Provide a clear and concise description of the problem.
validations:
required: true

- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to reproduce
description: List the exact steps needed to reproduce the issue.
placeholder: |
1. Go to...
2. Click on...
3. See the error...
- type: textarea
id: expected_behavior
attributes:
label: Expected behavior
description: Describe what you expected to happen instead of the issue observed.
placeholder: The system should...

- type: textarea
id: actual_behavior
attributes:
label: Actual behavior
description: Describe what actually happened.
placeholder: The system displayed...

- type: textarea
id: logs_and_files
attributes:
label: Logs and relevant files
description: |
Please upload logs and any relevant files that can help diagnose the problem. If file extensions are not allowed, create a `.zip` archive.
Examples of useful files:
- **Error logs**
- **Configuration files**
- **Screenshots of errors**
- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context or screenshots about the problem here.
11 changes: 11 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Feature request
description: Suggest an idea to improve BIPLAT-CIBERINFEC/patho-webcore
labels: enhancement
body:
- type: textarea
id: description
attributes:
label: Description of feature
description: You can provide here your suggestion for a new feature.
validations:
required: true
19 changes: 19 additions & 0 deletions .github/workflows/PULL_REQUEST_TEMPATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
# Pull Request Guidelines
Thank you for contributing to this repository!
Please review and complete the checklist below to ensure that your contribution adheres to the repository's standards. This helps maintain code quality and streamline the review process.
Pull requests should be made against the `develop` branch unless you're preparing for a release or instructed otherwise.
Learn more about contributing in the repository's CONTRIBUTING.md.
-->

## PR Checklist

- [ ] A clear and concise description of the changes is included in this pull request, along with the reasons for the changes.
- [ ] All code has been linted and meets the repository's style requirements.
- [ ] Any warnings or errors observed during testing have been addressed.
- [ ] The `CHANGELOG.md` file includes a summary of the changes made in this PR.
- [ ] The `README.md` file has been updated if applicable, including new references, contributors, or tools added.
45 changes: 45 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Main Branch Protection

# This workflow triggers on pull requests to the `main` branch
# It fails if a pull request is made to the `main` branch from any branch other than `develop` or branches prefixed with `patch`
on:
pull_request_target:
branches: [main]

jobs:
check-pr-source:
runs-on: ubuntu-latest
steps:
# Validate that pull requests to `main` only originate from `develop` or `patch` branches
- name: Validate Pull Request Source
run: |
if [[ ${{ github.event.pull_request.head.repo.full_name }} == "${{ github.repository }}" ]] && [[ ${{ github.event.pull_request.head.ref }} != "develop" && ${{ github.event.pull_request.head.ref }} != patch* ]]; then
echo "Pull Requests to 'main' are only allowed from 'develop' or branches prefixed with 'patch'."
exit 1
fi
# If the validation fails, post a comment on the pull request explaining the issue
# NOTE: This will not work for pull requests originating from forks due to GitHub Actions limitations with secrets
- name: Post Comment on Invalid Pull Request
if: failure()
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2
with:
message: |
## Invalid Pull Request to the `main` branch :x:
Pull requests targeting the `main` branch must originate from either the `develop` branch or a branch prefixed with `patch`.
### What you should do:
1. Do **not** close this pull request.
2. Click on the "Edit" button at the top of this page.
3. Change the target branch to `develop` or create a new branch prefixed with `patch` for hotfixes.
After making the changes, you must push a new commit to ensure this workflow passes.
**Important:** The `main` branch is reserved for release-ready code.
If you need assistance, feel free to ask in the discussion or reach out to the repository maintainers.
Thank you for your understanding and contributions!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# BIPLAT-CIBERINFEC/patho-webcore: Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Version Name]

### `Changed`

### `Added`

### `Fixed`

### `Dependencies`

### `Deprecated`

0 comments on commit 5be0521

Please sign in to comment.