Skip to content

Commit

Permalink
feat/merge-conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nike-getto committed Dec 4, 2024
2 parents 2dbeb7b + cc08d82 commit cd0642f
Show file tree
Hide file tree
Showing 30 changed files with 719 additions and 421 deletions.
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

68 changes: 68 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 🐛 Bug report
description: You found a bug!
title: '🐛 '
labels: ["🐛 Bug"]
projects: ["IntersectMBO/24", "IntersectMBO/34"]
body:
- type: markdown
attributes:
value: |
## 🌟 **Thank you for contributing to Constitutional Committee Portal!**
- type: markdown
attributes:
value: |
Before submitting a new issue please check the [existing issues](https://github.com/IntersectMBO/cc-portal/issues) to avoid duplication.
- type: dropdown
id: domain
attributes:
label: Domain
description: Which CC Portal instance were you connected to?
options:
- constitution.gov.tools
- sancho.constitution.gov.tools
- other
validations:
required: true

- type: textarea
id: context
attributes:
label: Context
description: Please give the context to what you were trying to achieve
placeholder: |
I was trying to see the latest CC member updates...
validations:
required: true

- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Explain the steps to reproduce
placeholder: |
1. Navigate to view constitution
2. Scroll to appendix
3. ...
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: A description of the erroneous outcome
placeholder: |
A error came up on the screen stating...
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A description of what you expect to happen instead
placeholder: |
The constitution appendix is legible and accessible...
validations:
required: true
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
blank_issues_enabled: true
contact_links:
- name: Contributing guidelines
url: https://github.com/IntersectMBO/xxxx/blob/master/CONTRIBUTING.md
url: https://github.com/IntersectMBO/cc-portal/blob/master/CONTRIBUTING.md
about: Some rules & processes we honor.

- name: Feature ideas
url: https://github.com/IntersectMBO/xxxx/discussions/categories/ideas
url: https://github.com/IntersectMBO/cc-portal/discussions/categories/ideas
about: Maybe someone else had the same or a similar idea already?

- name: All issues
url: https://github.com/IntersectMBO/xxxx/issues
url: https://github.com/IntersectMBO/cc-portal/issues
about: Check whether your issue is not already covered here.
67 changes: 48 additions & 19 deletions .github/ISSUE_TEMPLATE/feature_idea.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,73 @@
name: Feature idea
description: Idea or request for some feature on the xxxx roadmap
labels: [':thought_balloon: idea']
name: 💡 Feature idea
description: Idea or request for some feature on the CC Portal roadmap
title: "💡 "
labels: ["💡 Feature idea"]
projects: ["IntersectMBO/24", "IntersectMBO/34"]
body:
- type: markdown
attributes:
value:
value: |
**Thank you for contributing to our project!** :green_heart:
## 🌟 **Thank you for contributing to Constitutional Committee Portal!**
- type: markdown
attributes:
value: |
Before submitting a new issue consider [starting a new discussion](https://github.com/IntersectMBO/cc-portal/discussions/new?category=ideas).
Instead of opening this issue, consider [starting a new idea discussion](https://github.com/IntersectMBO/xxxx/discussions/new?category=ideas).
That way, we can discuss & refine your idea together, before we adopt it as a feature into the roadmap.
- type: dropdown
id: design-needed
attributes:
label: Is there new design needed?
description: Will this feature require new or edit to existing frontend designs?
options:
- 'Yes'
- 'No'
- Not sure
validations:
required: true

- type: textarea
id: why
id: what
attributes:
label: Why
description: Why do we need or want this feature
label: What?
description: What is this feature?
placeholder: |
Give context and describe the problem, challenge or opportunity you see
For example describe a new API endpoint, a change in wording,
a new configuration option, ...
validations:
required: true

- type: textarea
id: what
id: why
attributes:
label: What
description: What is this feature roughly about
label: Why?
description: Why do we need or want this feature?
placeholder: |
For example describe a new API endpoint, a change in messaging formats,
a new configuration option, ...
Give context and describe the problem the idea solves
validations:
required: true

- type: textarea
id: how
attributes:
label: How
description: How could we realize this feature
label: How?
description: How can we realize this feature?
placeholder: |
Which technical solutions, libraries or systems should be used, which
components need to change, steps how to implement this, ...
validations:
required: true
required: true

- type: markdown
attributes:
value: |
---
- type: textarea
id: user-story
attributes:
label: (Optional) User Story with acceptance criteria
description: See examples [here](https://github.com/IntersectMBO/cardano-test-plans/blob/main/userStoryInventoryChangHF.md#2g-delegate-to-self-for-registered-dreps).
placeholder: |
As a [ada holder | DRep | Direct voter], I want [some goal] so that [some reason].
validations:
required: false
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

## Checklist

- [related issue](https://github.com/IntersectMBO/xxxx/issues/)
- [related issue](https://github.com/IntersectMBO/cc-portal/issues/)
- [ ] My changes generate no new warnings
- [ ] My code follows the [style guidelines](https://github.com/IntersectMBO/xxxx/tree/main/docs/style-guides) of this project
- [ ] My code follows the [style guidelines](https://github.com/IntersectMBO/cc-portal/tree/main/docs/style-guides) of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
61 changes: 61 additions & 0 deletions .github/workflows/label-feature-idea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Add labels to 💡 Feature idea issues

on:
issues:
types: [opened, edited]

permissions:
issues: write
contents: read

jobs:
apply-labels:
runs-on: ubuntu-latest
steps:
- name: Check if issue is a "💡 Feature idea"
id: check_is_feature_idea
run: |
echo "## Checking if issue is a 'Feature idea'..."
if [[ "${{ github.event.issue.title }}" == "💡 "* ]]; then
echo "is_feature_idea=true" >> $GITHUB_ENV
else
echo "is_feature_idea=false" >> $GITHUB_ENV
fi
- name: Apply "🎨 Design Needed" label if design needed is "Yes"
if: ${{ env.is_feature_idea == 'true' }}
uses: actions/github-script@v6
with:
script: |
const issueBody = context.payload.issue.body;
// Match the "Yes" selection under the "### Is there new design needed?" header
const designNeededMatch = issueBody.match(/### Is there new design needed\?\s*\n\s*Yes\s*\n/);
if (designNeededMatch) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["🎨 Design Needed"],
});
}
- name: Apply "User Story Needed" label if user story not provided
if: ${{ env.is_feature_idea == 'true' }}
uses: actions/github-script@v6
with:
script: |
const issueBody = context.payload.issue.body;
const userStoryPattern = /### \(Optional\) User Story with acceptance criteria\s*\n\s*_No response_/;
const userStoryMissing = userStoryPattern.test(issueBody);
if (userStoryMissing) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["User Story Needed"],
});
}
38 changes: 13 additions & 25 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
- develop
- staging
- beta
- main
- master

permissions:
contents: write
pull-requests: write
packages: write

env:
ENVIRONMENT: ${{ (github.ref_name == 'main' && 'prod-cc-portal') || (github.ref_name == 'beta' && 'pre-prod-cc-portal') || (github.ref_name == 'staging' && 'qa-cc-portal') || (github.ref_name == 'develop' && 'dev-cc-portal') }}
ENVIRONMENT: ${{ (github.ref_name == 'master' && 'prod-cc-portal') || (github.ref_name == 'beta' && 'pre-prod-cc-portal') || (github.ref_name == 'staging' && 'qa-cc-portal') || (github.ref_name == 'develop' && 'dev-cc-portal') }}

jobs:
check-build-deploy:
Expand Down Expand Up @@ -91,7 +91,6 @@ jobs:
set -o pipefail
sudo chmod +x lint.sh && ./lint.sh 2>&1 | tee code_lint_output.txt
- name: Unit tests
id: unit_tests
run: |
Expand Down Expand Up @@ -130,24 +129,23 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
outputs: type=docker,dest=/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar
build-args: |
NEXT_PUBLIC_API_URL=${{ secrets.QA_NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_USERSNAP_SPACE_API_KEY=${{ secrets.QA_NEXT_PUBLIC_USERSNAP_SPACE_API_KEY }}
NEXT_PUBLIC_USERSNAP_PROJECT_API_KEY=${{ secrets.QA_NEXT_PUBLIC_USERSNAP_PROJECT_API_KEY }}
NEXT_PUBLIC_HIDDEN_USERSNAP_PROJECT_IDS=${{ secrets.QA_NEXT_PUBLIC_HIDDEN_USERSNAP_PROJECT_IDS }}
NEXT_PUBLIC_IS_MAINNET=${{ secrets.QA_NEXT_PUBLIC_IS_MAINNET }}g
NEXT_PUBLIC_API_URL=${{ secrets.PROD_NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_USERSNAP_SPACE_API_KEY=${{ secrets.PROD_NEXT_PUBLIC_USERSNAP_SPACE_API_KEY }}
NEXT_PUBLIC_USERSNAP_PROJECT_API_KEY=${{ secrets.PROD_NEXT_PUBLIC_USERSNAP_PROJECT_API_KEY }}
NEXT_PUBLIC_HIDDEN_USERSNAP_PROJECT_IDS=${{ secrets.PROD_NEXT_PUBLIC_HIDDEN_USERSNAP_PROJECT_IDS }}
NEXT_PUBLIC_IS_MAINNET=${{ secrets.PROD_NEXT_PUBLIC_IS_MAINNET }}
- name: Scan Docker image with Dockle
id: dockle
run: |
wget -q https://github.com/goodwithtech/dockle/releases/download/v0.4.14/dockle_0.4.14_Linux-64bit.tar.gz
tar zxf dockle_0.4.14_Linux-64bit.tar.gz
sudo mv dockle /usr/local/bin
dockle --exit-code 1 --exit-level fatal --format json --input '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar' --output ${{ matrix.workdir }}/dockle_scan_output.json
cat ${{ matrix.workdir }}/dockle_scan_output.json
wget -q https://github.com/goodwithtech/dockle/releases/download/v0.4.14/dockle_0.4.14_Linux-64bit.tar.gz
tar zxf dockle_0.4.14_Linux-64bit.tar.gz
sudo mv dockle /usr/local/bin
echo "outcome=success" >> $GITHUB_OUTPUT
dockle --exit-code 1 --exit-level fatal --format json --input '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar' --output ${{ matrix.workdir }}/dockle_scan_output.json
cat ${{ matrix.workdir }}/dockle_scan_output.json
echo "outcome=success" >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@v2
Expand All @@ -156,22 +154,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- name: Push Docker image to GHCR
run: |
docker load -i '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar'
rm -rf '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar'
docker push ${{ steps.image_lowercase.outputs.lowercase }}:${{ env.TAG }}
- name: Add tag as a PR comment
uses: ubie-oss/[email protected]
id: comment-to-merged-pr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
message: |-
This PR is in the tag: ${{ env.TAG }} , for ${{ matrix.name }} service
- name: Deploy with Qovery
if: github.ref == 'refs/heads/develop'
env:
Expand Down
Loading

0 comments on commit cd0642f

Please sign in to comment.