Skip to content

Commit

Permalink
Merge branch 'main' into survey-form
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravtb2253 authored Nov 1, 2024
2 parents dbecb14 + 2d4e54c commit b0ee529
Show file tree
Hide file tree
Showing 30 changed files with 2,522 additions and 1,147 deletions.
63 changes: 26 additions & 37 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,47 @@
name: 🐛 Bug
description: Report an issue to help improve the project.
title: "[BUG] <description>"
labels: ["bug"]
name: '🐞 Bug Report'
description: 'Create a detailed report to help us improve'
title: 'BUG:'
labels: ['Bug']
body:
- type: checkboxes
id: duplicates
attributes:
label: Has this bug been raised before?
description: Increase the chances of your issue being accepted by making sure it has not been raised before.
label: 'Preliminary Check'
description: 'Please confirm the following before reporting a bug.'
options:
- label: I have checked "open" AND "closed" issues and this is not a duplicate
- label: 'I have searched the existing issues'
required: true
- label: 'This issue is reproducible'
required: true
- type: textarea
id: description
attributes:
label: Description
description: A clear description of the bug you have found. Please include relevant information and resources (for example the steps to reproduce the bug)
label: 'Bug Summary'
description: 'Provide a concise summary of the bug, including what you expected to happen and what actually happened.'
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to Reproduce
description: To help us recreate the bug, provide a numbered list of the exact steps taken to trigger the buggy behavior.
value: |
Include any relevant details like:
- What page you were on...
- What you were trying to do...
- What went wrong...
label: 'Steps to Reproduce'
description: 'List the steps to reproduce the bug. Include specific details so that we can easily replicate the issue.'
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please add screenshots if applicable
label: 'Expected Behavior'
description: 'What did you expect to happen instead?'
validations:
required: false
- type: dropdown
id: assignee
- type: textarea
attributes:
label: Do you want to work on this issue?
multiple: false
options:
- "No"
- "Yes"
default: 0
label: 'Screenshots/Logs'
description: 'If applicable, add screenshots or logs that can help us understand the issue better.'
validations:
required: false
- type: textarea
id: extrainfo
- type: checkboxes
attributes:
label: If "yes" to above, please explain how you would technically implement this
description: For example reference any existing code
validations:
required: false
label: 'Additional Information'
options:
- label: "I agree to follow this project's Code of Conduct"
required: true
- label: "I'm a GSSOC'24 contributor"
- label: 'I want to work on this issue'
- label: 'I can provide more details if needed'
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/documentaion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: '📝 Documentation Update'
description: 'Propose an update or correction to the documentation'
title: 'DOC UPDATE:'
labels: ['Documentation']
body:
- type: textarea
attributes:
label: 'Documentation Page'
description: 'Which page or section of the documentation needs to be updated?'
validations:
required: true
- type: textarea
attributes:
label: 'Description of Changes'
description: 'Describe the changes you propose for the documentation.'
validations:
required: true
- type: textarea
attributes:
label: 'Reason for Update'
description: 'Explain why these changes are necessary or beneficial.'
validations:
required: false
- type: textarea
attributes:
label: 'Screenshots/Logs'
description: 'If applicable, add screenshots or logs that can help us understand the issue better.'
validations:
required: false
- type: checkboxes
attributes:
label: 'Additional Information'
options:
- label: 'I have checked the documentation for accuracy'
required: true
- label: 'I am willing to help with this update'
- label: 'I can provide further clarification if needed'
56 changes: 24 additions & 32 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
name: 💡 General Feature Request
description: Have a new idea/feature? Let us know...
title: "[FEATURE] <description>"
labels: ["enhancement", "feature"]
name: '🌟 Feature Request'
description: 'Suggest a new feature to enhance our project.'
title: 'FEATURE:'
labels: ['Feature Request']
body:
- type: checkboxes
id: duplicates
attributes:
label: Is this a unique feature?
description: Increase the chances of your issue being accepted by making sure it has not been raised before.
options:
- label: I have checked "open" AND "closed" issues and this is not a duplicate
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem/unavailable functionality? Please describe.
description: A clear and concise description of what the problem is (for example "I'm always frustrated when [...]").
label: 'Feature Summary'
description: 'Provide a brief summary of the feature you would like to see implemented. Try to keep it concise.'
validations:
required: true
- type: textarea
id: description
attributes:
label: Proposed Solution
description: A clear description of the enhancement you propose. Please include relevant information and resources (for example another project's implementation of this feature).
label: 'Description'
description: 'Explain why this feature is needed. What problem does it solve, or what value does it add for users?'
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please add screenshots of the before and/or after the proposed changes.
label: 'Proposed Solution'
description: 'Describe your proposed solution or how you envision the feature working. Include any relevant details such as user stories or use cases.'
validations:
required: false
- type: dropdown
id: assignee
- type: textarea
attributes:
label: Do you want to work on this issue?
multiple: false
options:
- "No"
- "Yes"
default: 0
label: 'Alternatives Considered'
description: 'Have you considered any alternatives to this feature? If so, please describe them and why they might be less effective.'
validations:
required: false
- type: textarea
id: extrainfo
attributes:
label: If "yes" to above, please explain how you would technically implement this (issue will not be assigned if this is skipped)
description: For example reference any existing code or library
label: 'Screenshots/Logs'
description: 'If applicable, add screenshots or logs that can help us understand the issue better.'
validations:
required: false
required: false
- type: checkboxes
attributes:
label: 'Additional Information'
options:
- label: 'I have searched for existing feature requests'
required: true
- label: 'I am willing to help implement this feature'
- label: 'I can provide more details or clarification if needed'
43 changes: 43 additions & 0 deletions .github/pullrequest_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 🛠️ Fixes Issue

Fixes: #<issue_number>

# 👨‍💻 Description

## What does this PR do?

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

- Briefly describe the feature or bug fix you've implemented.
- Highlight any major changes or added functionality.
- Mention how it enhances the project.

# 📄 Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update (adds or updates related documentation)

# 📷 Screenshots/GIFs (if any)

Include screenshots or GIFs to demonstrate your changes

# ✅ Checklist

- [ ] I am a participant of GSSoC-ext.
- [ ] I have followed the contribution guidelines of this project.
- [ ] I have made this change from my own.
- [ ] I have taken help from some online resources.
- [ ] My code follows the style guidelines of this project.
- [ ] I have performed a self-review of my own code.
- [ ] I have added documentation to explain my changes.

## Mandatory Tasks

- [ ] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

# 🤝 GSSoC Participation

- [ ] This PR is submitted under the GSSoC program.
- [ ] I have taken prior approval for this feature/fix.
101 changes: 101 additions & 0 deletions .github/scripts/update_structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
import github
from github import Github

# Helper function to recursively build the repo structure and include file extensions
def get_repo_structure(path='.', prefix=''):
structure = []
try:
items = sorted(os.listdir(path))
except FileNotFoundError:
print(f"Path not found: {path}")
return structure

for i, item in enumerate(items):
if item.startswith('.'):
continue # Skip hidden files and directories
item_path = os.path.join(path, item)
is_last = i == len(items) - 1
current_prefix = '└── ' if is_last else '├── '

if os.path.isdir(item_path):
# Directory case
structure.append(f"{prefix}{current_prefix}{item}/")
next_prefix = prefix + (' ' if is_last else '│ ')
structure.extend(get_repo_structure(item_path, next_prefix))
else:
# File case with extension
file_name, file_extension = os.path.splitext(item)
structure.append(f"{prefix}{current_prefix}{file_name}{file_extension}")

return structure

# Function to update the repo_structure.txt file
def update_structure_file(structure):
try:
with open('repo_structure.txt', 'w') as f:
f.write('\n'.join(structure))
print("repo_structure.txt updated successfully.")
except IOError as e:
print(f"Error writing to repo_structure.txt: {e}")

# Function to update the README.md with the new structure
def update_README(structure):
try:
with open('PROJECT_STRUCTURE.md', 'r') as f:
content = f.read()
except FileNotFoundError:
print("PROJECT_STRUCTURE.md not found.")
return

start_marker = '<!-- START_STRUCTURE -->'
end_marker = '<!-- END_STRUCTURE -->'

start_index = content.find(start_marker)
end_index = content.find(end_marker)

if start_index != -1 and end_index != -1:
new_content = (
content[:start_index + len(start_marker)] +
'\n```\n' + '\n'.join(structure) + '\n```\n' +
content[end_index:]
)
try:
with open('PROJECT_STRUCTURE.md', 'w') as f:
f.write(new_content)
print("PROJECT_STRUCTURE.md updated with new structure.")
except IOError as e:
print(f"Error writing to PROJECT_STRUCTURE.md: {e}")
else:
print("Markers not found in PROJECT_STRUCTURE.md. Structure not updated.")

# Main function to compare and update repository structure
def main():
gh_token = os.getenv('GH_TOKEN')
gh_repo = os.getenv('GITHUB_REPOSITORY')

if not gh_token or not gh_repo:
print("Environment variables GH_TOKEN and GITHUB_REPOSITORY must be set.")
return

g = Github(gh_token)
repo = g.get_repo(gh_repo)

current_structure = get_repo_structure()

try:
# Fetch the contents of repo_structure.txt from GitHub
contents = repo.get_contents("repo_structure.txt")
existing_structure = contents.decoded_content.decode().split('\n')
except github.GithubException:
existing_structure = None

if current_structure != existing_structure:
update_structure_file(current_structure)
update_README(current_structure)
print("Repository structure updated.")
else:
print("No changes in repository structure.")

if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update Repository structure

on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch: # Allow manual triggering
push:
branches:
- main
- master

jobs:
detect-and-update-structure:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: Run update script
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/update_structure.py

- name: Commit and push if changed
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push)
Loading

0 comments on commit b0ee529

Please sign in to comment.