From 72b32774ba7a3558933fcc18513da9cc68f1dfc3 Mon Sep 17 00:00:00 2001 From: sanjay kumar sah Date: Mon, 21 Jul 2025 18:21:24 +0530 Subject: [PATCH 1/2] chore(.github): add github actions --- .github/ISSUE_TEMPLATE.md | 17 ---------- .github/ISSUE_TEMPLATE/bug_report.yml | 29 ++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 27 +++++++++++++++ .github/ISSUE_TEMPLATE/task.yml | 19 +++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 14 -------- .../PULL_REQUEST_TEMPLATE/bugfix_template.md | 15 ++++++++ .../PULL_REQUEST_TEMPLATE/feature_template.md | 16 +++++++++ .../refactor_template.md | 22 ++++++++++++ .github/pull_request_template.md | 7 ++++ .github/workflows/label-pr-by-title.yml | 34 +++++++++++++++++++ .vscode/settings.json | 2 +- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 14 ++++---- LICENSE | 4 +-- 14 files changed, 179 insertions(+), 43 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/ISSUE_TEMPLATE/task.yml delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/bugfix_template.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/feature_template.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/refactor_template.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/label-pr-by-title.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3e98f75..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ -## Issue Summary - -[Provide a short summary of the issue.] - -## Steps to Reproduce - -1. Step one -2. Step two -3. Step three - -## Expected Behavior - -[Explain what you expected to happen.] - -## Actual Behavior - -[Explain what actually happened.] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..a157e1e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,29 @@ +name: Bug report +description: Template for reporting issues with environment details +title: "[BUG] " +labels: [bug] +body: + - "## Issue Summary" + - "" + - "[Provide a short summary of the issue.]" + - "" + - "## Steps to Reproduce" + - "" + - "1. Step one" + - "2. Step two" + - "3. Step three" + - "" + - "## Expected Behavior" + - "" + - "[Explain what you expected to happen.]" + - "" + - "## Actual Behavior" + - "" + - "[Explain what actually happened.]" + - "" + - "## Environment" + - "" + - "- Operating System:" + - "- Node.js version:" + - "- pnpm version:" + - "- Project version:" diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..7ea31f2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,27 @@ +name: Feature Request +description: Template for suggesting new features or enhancements +title: "[FEATURE] " +labels: [enhancement] +body: + - "## Feature Summary" + - "" + - "[Provide a short summary of the feature or enhancement.]" + - "" + - "## Motivation" + - "" + - "[Explain why this feature is needed and the problem it solves.]" + - "" + - "## Proposed Solution" + - "" + - "[Describe the solution or approach you suggest.]" + - "" + - "## Alternatives Considered" + - "" + - "[List any alternative solutions or features you considered.]" + - "" + - "## Environment" + - "" + - "- Operating System:" + - "- Node.js version:" + - "- pnpm version:" + - "- Project version:" diff --git a/.github/ISSUE_TEMPLATE/task.yml b/.github/ISSUE_TEMPLATE/task.yml new file mode 100644 index 0000000..ab57c07 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task.yml @@ -0,0 +1,19 @@ +name: Task +description: Template for tracking tasks or to-dos +title: "[TASK] " +labels: [task] +body: + - "## Task Summary" + - "" + - "[Provide a short description of the task.]" + - "" + - "## Details" + - "" + - "[Provide detailed information about the task.]" + - "" + - "## Environment" + - "" + - "- Operating System:" + - "- Node.js version:" + - "- pnpm version:" + - "- Project version:" diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d20ed42..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ -## What changes have been made? - -[Provide a short description of the changes.] - -## Related Issues or Tasks - -[Link to any related issues or tasks.] - -## Checklist - -- [ ] Code has been linted. -- [ ] Tests have been added (if applicable). -- [ ] Code has been formatted with Prettier. -- [ ] Documentation has been updated (if applicable). diff --git a/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md b/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md new file mode 100644 index 0000000..6697efb --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md @@ -0,0 +1,15 @@ + + +## ๐Ÿ› Bug Fix Description + +What was the bug? How was it fixed? + +## ๐Ÿ”— Related Issues + +Link any issues this PR fixes. + +## โœ… Checklist + +- [ ] Bug is fixed +- [ ] Regressions tested +- [ ] Lint and tests pass diff --git a/.github/PULL_REQUEST_TEMPLATE/feature_template.md b/.github/PULL_REQUEST_TEMPLATE/feature_template.md new file mode 100644 index 0000000..b285296 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/feature_template.md @@ -0,0 +1,16 @@ + + +## โœจ Feature Description + +Describe the new feature and its purpose. + +## ๐Ÿ“Œ Related Issues / Tasks + +Link any related issues or task IDs. + +## โœ… Checklist + +- [ ] Feature works as expected +- [ ] Code is linted and formatted +- [ ] Tests have been written +- [ ] Docs are updated if needed diff --git a/.github/PULL_REQUEST_TEMPLATE/refactor_template.md b/.github/PULL_REQUEST_TEMPLATE/refactor_template.md new file mode 100644 index 0000000..abf8996 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/refactor_template.md @@ -0,0 +1,22 @@ +## ๐Ÿงน Refactor Description + +Describe the changes made for code cleanup, restructuring, or optimization. +Clearly mention if the behavior or logic remains unchanged. + +## ๐Ÿ“‚ Why Refactor? + +Explain the motivation behind the refactor. +For example: improve readability, performance, maintainability, or remove duplication. + +## ๐Ÿ”— Related Issues / Tasks + +Link any related issue, task, or technical debt ticket. + +## โœ… Checklist + +- [ ] No breaking changes introduced +- [ ] Code behavior remains consistent (if applicable) +- [ ] Code is cleaner and easier to maintain +- [ ] All tests still pass +- [ ] New tests added for refactored parts (if needed) +- [ ] Documentation updated (if needed) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..216518e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ + + +๐Ÿ‘‹ **Please select the appropriate PR template from the list.** + +- [New Feature](./PULL_REQUEST_TEMPLATE/feature_template.md) +- [Bug Fix](./PULL_REQUEST_TEMPLATE/bugfix_template.md) +- [Refactor](./PULL_REQUEST_TEMPLATE/refactor_template.md) diff --git a/.github/workflows/label-pr-by-title.yml b/.github/workflows/label-pr-by-title.yml new file mode 100644 index 0000000..183bd6f --- /dev/null +++ b/.github/workflows/label-pr-by-title.yml @@ -0,0 +1,34 @@ +name: ๐Ÿ”– Label PRs by Title + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - name: ๐Ÿท๏ธ Add labels based on PR title + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const title = context.payload.pull_request.title.toLowerCase(); + const labels = []; + + if (title.startsWith('[feature]')) { + labels.push('type:feature'); + } else if (title.startsWith('[bugfix]')) { + labels.push('type:bugfix'); + } else if (title.startsWith('[refactor]')) { + labels.push('type:refactor'); + } + + if (labels.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels + }); + } diff --git a/.vscode/settings.json b/.vscode/settings.json index cb371f9..5ad1573 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "cSpell.words": ["maxlength", "Parens", "pino", "trivago"], + "cSpell.words": ["Ansopedia", "maxlength", "Parens", "pino", "trivago"], "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": "always", diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5981512..7cc75a0 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -36,7 +36,7 @@ This Code of Conduct applies within all community spaces, and also applies when ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email address]. All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email address](mailto:group.ansopedia@gmail.com). 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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44709d8..fb07144 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,6 @@ By participating in this project, you agree to uphold our [Code of Conduct](./CO - A **Contributor** is any individual who creates an issue/PR, comments on an issue/PR, or contributes in some other way. - A **Collaborator** is a contributor with write access to the repository. See [here](#becoming-a-collaborator) on how to become a collaborator. -You can find more details and guides about Collaborating with this repository through our [Collaborator Guide](./COLLABORATOR_GUIDE.md). - ### Becoming a Collaborator A collaborator of the Ansopedia and its repository is a member of the Ansopedia Team. @@ -72,9 +70,9 @@ Once you've forked the repository, clone it to your local machine: Clone your fork using SSH, GitHub CLI, or HTTPS. ```bash -git clone git@github.com:ansopedia/notification-service.git # SSH -git clone https://github.com/ansopedia/notification-service.git # HTTPS -gh repo clone ansopedia/notification-service # GitHub CLI +git clone git@github.com:/notification-service.git # SSH +git clone https://github.com//notification-service.git # HTTPS +gh repo clone /notification-service # GitHub CLI ``` #### 3. Change into the notification-service directory. @@ -88,7 +86,7 @@ cd notification-service Create a new branch for your feature, bug fix, or documentation update: ```bash - git checkout -b +git checkout -b ``` #### 5. **Install Dependencies** @@ -126,7 +124,7 @@ git commit -m "Add new feature for notification registration" Push your changes to your forked Repository on GitHub: ```bash - git push -u origin name-of-your-branch +git push -u origin name-of-your-branch ``` #### 10. **Create a Pull Request (PR)** @@ -168,7 +166,7 @@ Ensure that your code adheres to the existing coding standards and passes all te ### Pre-commit Hooks -This project uses [Husky][] for Git pre-commit hooks. +This project uses [Husky](https://typicode.github.io/husky/) for Git pre-commit hooks. ### When merging diff --git a/LICENSE b/LICENSE index 358a990..65f5333 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014 The Android Open Source Project + Copyright 2025 Ansopedia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +198,4 @@ 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. \ No newline at end of file + limitations under the License. From cd323c8328712bcd493ccc1c44682ecf2d3f14f4 Mon Sep 17 00:00:00 2001 From: sanjay kumar sah Date: Mon, 21 Jul 2025 18:57:03 +0530 Subject: [PATCH 2/2] chore: update github issues --- .github/ISSUE_TEMPLATE/bug_report.yml | 55 +++++++++-------- .github/ISSUE_TEMPLATE/config.yml | 4 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 61 +++++++++++-------- .github/ISSUE_TEMPLATE/task.yml | 19 ------ .../PULL_REQUEST_TEMPLATE/bugfix_template.md | 4 -- .../PULL_REQUEST_TEMPLATE/feature_template.md | 4 -- .../refactor_template.md | 2 - .github/pull_request_template.md | 4 +- 8 files changed, 70 insertions(+), 83 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/task.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a157e1e..13c514c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,29 +1,30 @@ -name: Bug report -description: Template for reporting issues with environment details -title: "[BUG] " +name: "๐Ÿ› Bug Report" +description: "Report a bug in the application" labels: [bug] body: - - "## Issue Summary" - - "" - - "[Provide a short summary of the issue.]" - - "" - - "## Steps to Reproduce" - - "" - - "1. Step one" - - "2. Step two" - - "3. Step three" - - "" - - "## Expected Behavior" - - "" - - "[Explain what you expected to happen.]" - - "" - - "## Actual Behavior" - - "" - - "[Explain what actually happened.]" - - "" - - "## Environment" - - "" - - "- Operating System:" - - "- Node.js version:" - - "- pnpm version:" - - "- Project version:" + - type: markdown + attributes: + value: | + ## Describe the Bug + - type: textarea + id: bug-description + attributes: + label: "What happened?" + description: "Describe what the bug is, and how to reproduce it." + placeholder: "Steps to reproduce the bug..." + - type: textarea + id: steps-to-reproduce + attributes: + label: "Steps to Reproduce" + description: | + 1. Go to '...' + 2. Click on '...' + 3. Scroll down to '...' + 4. See error + placeholder: "List the steps to reproduce the bug..." + - type: input + id: environment + attributes: + label: "Environment (OS, Node.js, pnpm, Project version)" + description: "Provide details about your environment to help with debugging." + placeholder: "e.g. Ubuntu 20.04, Node.js 16.13.0, pnpm 6.14.5, v1.2.3" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f55336f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: ๐Ÿ“ฌ Contact the Team + url: https://github.com/ansopedia/notification-service/discussions + about: Ask questions, suggest ideas, or start a discussion \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 7ea31f2..a7de237 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,27 +1,38 @@ -name: Feature Request -description: Template for suggesting new features or enhancements -title: "[FEATURE] " +name: "โœจ Feature Request" +description: "Suggest a new feature or enhancement" labels: [enhancement] body: - - "## Feature Summary" - - "" - - "[Provide a short summary of the feature or enhancement.]" - - "" - - "## Motivation" - - "" - - "[Explain why this feature is needed and the problem it solves.]" - - "" - - "## Proposed Solution" - - "" - - "[Describe the solution or approach you suggest.]" - - "" - - "## Alternatives Considered" - - "" - - "[List any alternative solutions or features you considered.]" - - "" - - "## Environment" - - "" - - "- Operating System:" - - "- Node.js version:" - - "- pnpm version:" - - "- Project version:" + - type: markdown + attributes: + value: | + ## Feature Summary + - type: textarea + id: feature-summary + attributes: + label: "Summary" + description: "Provide a short summary of the feature or enhancement." + placeholder: "Briefly describe the feature..." + - type: textarea + id: motivation + attributes: + label: "Motivation" + description: "Explain why this feature is needed and the problem it solves." + placeholder: "Why is this feature important?" + - type: textarea + id: proposed-solution + attributes: + label: "Proposed Solution" + description: "Describe the solution or approach you suggest." + placeholder: "How would you implement this feature?" + - type: textarea + id: alternatives + attributes: + label: "Alternatives Considered" + description: "List any alternative solutions or features you considered." + placeholder: "Other options you considered..." + - type: input + id: environment + attributes: + label: "Environment (OS, Node.js, pnpm, Project version)" + description: "Provide details about your environment to help with debugging." + placeholder: "e.g. Ubuntu 20.04, Node.js 16.13.0, pnpm 6.14.5, v1.2.3" diff --git a/.github/ISSUE_TEMPLATE/task.yml b/.github/ISSUE_TEMPLATE/task.yml deleted file mode 100644 index ab57c07..0000000 --- a/.github/ISSUE_TEMPLATE/task.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Task -description: Template for tracking tasks or to-dos -title: "[TASK] " -labels: [task] -body: - - "## Task Summary" - - "" - - "[Provide a short description of the task.]" - - "" - - "## Details" - - "" - - "[Provide detailed information about the task.]" - - "" - - "## Environment" - - "" - - "- Operating System:" - - "- Node.js version:" - - "- pnpm version:" - - "- Project version:" diff --git a/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md b/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md index 6697efb..0e9c015 100644 --- a/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/bugfix_template.md @@ -1,7 +1,3 @@ - - -## ๐Ÿ› Bug Fix Description - What was the bug? How was it fixed? ## ๐Ÿ”— Related Issues diff --git a/.github/PULL_REQUEST_TEMPLATE/feature_template.md b/.github/PULL_REQUEST_TEMPLATE/feature_template.md index b285296..f05f065 100644 --- a/.github/PULL_REQUEST_TEMPLATE/feature_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/feature_template.md @@ -1,7 +1,3 @@ - - -## โœจ Feature Description - Describe the new feature and its purpose. ## ๐Ÿ“Œ Related Issues / Tasks diff --git a/.github/PULL_REQUEST_TEMPLATE/refactor_template.md b/.github/PULL_REQUEST_TEMPLATE/refactor_template.md index abf8996..e194bf8 100644 --- a/.github/PULL_REQUEST_TEMPLATE/refactor_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/refactor_template.md @@ -1,5 +1,3 @@ -## ๐Ÿงน Refactor Description - Describe the changes made for code cleanup, restructuring, or optimization. Clearly mention if the behavior or logic remains unchanged. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 216518e..f337edb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,7 @@ - - ๐Ÿ‘‹ **Please select the appropriate PR template from the list.** - [New Feature](./PULL_REQUEST_TEMPLATE/feature_template.md) - [Bug Fix](./PULL_REQUEST_TEMPLATE/bugfix_template.md) - [Refactor](./PULL_REQUEST_TEMPLATE/refactor_template.md) + +_Ensure your PR title starts with `[feature]`, `[bugfix]`, or `[refactor]` so labels are added automatically._