From ff71c12d6e24d4fd9c5be3f219d3d06096e56245 Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 4 Oct 2024 18:16:47 -0400 Subject: [PATCH 01/35] feat: add and test many-to-many relationship between program_area and project --- .../migrations/0028_project_program_areas.py | 20 ++++++++++++ app/core/migrations/max_migration.txt | 2 +- app/core/models.py | 6 ++++ app/core/tests/test_api.py | 12 +++++++ app/core/tests/test_models.py | 32 +++++++++++++++++++ scripts/createsuperuser.sh | 2 +- 6 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 app/core/migrations/0028_project_program_areas.py diff --git a/app/core/migrations/0028_project_program_areas.py b/app/core/migrations/0028_project_program_areas.py new file mode 100644 index 00000000..c8dea90f --- /dev/null +++ b/app/core/migrations/0028_project_program_areas.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.11 on 2024-10-04 18:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0027_socmajor"), + ] + + operations = [ + migrations.AddField( + model_name="project", + name="program_areas", + field=models.ManyToManyField( + blank=True, related_name="projects", to="core.programarea" + ), + ), + ] diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index 49e70d1d..56c2f06d 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0027_socmajor +0028_project_program_areas diff --git a/app/core/models.py b/app/core/models.py index b49ecee7..2260de28 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -144,6 +144,12 @@ class Project(AbstractBaseModel): image_logo = models.URLField(blank=True) image_hero = models.URLField(blank=True) image_icon = models.URLField(blank=True) + program_areas = models.ManyToManyField( + "ProgramArea", + related_name="projects", + blank=True, + # through="ProjectProgramAreaXref" + ) def __str__(self): return f"{self.name}" diff --git a/app/core/tests/test_api.py b/app/core/tests/test_api.py index 661d546f..d83c2ec1 100644 --- a/app/core/tests/test_api.py +++ b/app/core/tests/test_api.py @@ -22,6 +22,7 @@ SKILL_URL = reverse("skill-list") STACK_ELEMENT_URL = reverse("stack-element-list") PERMISSION_TYPE = reverse("permission-type-list") +PROJECT_URL = reverse("project-list") STACK_ELEMENT_TYPE_URL = reverse("stack-element-type-list") SDG_URL = reverse("sdg-list") AFFILIATION_URL = reverse("affiliation-list") @@ -381,3 +382,14 @@ def test_create_soc_major(auth_client): res = auth_client.post(SOC_MAJOR_URL, payload) assert res.status_code == status.HTTP_201_CREATED assert res.data["title"] == payload["title"] + + +# def test_project_program_area_xref(auth_client, project, program_area): +# project.program_areas.add(program_area) +# project.save() + +# proj_res = auth_client.get(PROJECT_URL) +# program_area_res = auth_client.get(PROGRAM_AREA_URL) + +# assert filter(lambda proj: str(proj["uuid"]) == str(project.pk), proj_res.data) +# assert filter(lambda _sdg: str(_program_area["uuid"]) == str(program_area.pk), program_area_res) diff --git a/app/core/tests/test_models.py b/app/core/tests/test_models.py index 9617496e..1635de05 100644 --- a/app/core/tests/test_models.py +++ b/app/core/tests/test_models.py @@ -3,6 +3,8 @@ import pytest from ..models import Event +from ..models import ProgramArea +from ..models import Project pytestmark = pytest.mark.django_db @@ -145,3 +147,33 @@ def test_check_type(check_type): def test_soc_major(soc_major): assert str(soc_major) == "Test Soc Major" + + +def test_project_program_area_relationship(project): + civic_tech_infrastructure_program_area = ProgramArea.objects.get( + name="Civic Tech Infrastructure" + ) + workforce_program_area = ProgramArea.objects.get(name="Workforce Development") + hack_for_la_project = Project.objects.create(name="Hack for LA Site") + hack_for_la_project.program_areas.add( + civic_tech_infrastructure_program_area, workforce_program_area + ) + assert hack_for_la_project.program_areas.count() == 2 + assert hack_for_la_project.program_areas.contains( + civic_tech_infrastructure_program_area + ) + assert hack_for_la_project.program_areas.contains(workforce_program_area) + assert civic_tech_infrastructure_program_area.projects.contains(hack_for_la_project) + assert workforce_program_area.projects.contains(hack_for_la_project) + + hack_for_la_project.program_areas.remove(civic_tech_infrastructure_program_area) + assert hack_for_la_project.program_areas.count() == 1 + assert not hack_for_la_project.program_areas.contains( + civic_tech_infrastructure_program_area + ) + assert hack_for_la_project.program_areas.contains(workforce_program_area) + + assert not civic_tech_infrastructure_program_area.projects.contains( + hack_for_la_project + ) + assert workforce_program_area.projects.contains(hack_for_la_project) diff --git a/scripts/createsuperuser.sh b/scripts/createsuperuser.sh index 9f7ffdb4..8c299a9d 100755 --- a/scripts/createsuperuser.sh +++ b/scripts/createsuperuser.sh @@ -8,5 +8,5 @@ set -x # This command requires the DJANGO_SUPERUSER_USERNAME and # DJANGO_SUPERUSER_PASSWORD environmental variables to be set when django starts -echo "DJANGO_SUPERUSER_USERNAME: $DJANGO_SUPERUSER_USERNAME" +# echo "DJANGO_SUPERUSER_USERNAME: $DJANGO_SUPERUSER_USERNAME" docker-compose exec web python manage.py createsuperuser --no-input From 2e5fbb01eb8f9cf9793113ddbac15441ce08a136 Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 4 Oct 2024 20:43:53 -0400 Subject: [PATCH 02/35] feat: update serializers: project and program_area --- app/core/api/serializers.py | 7 ++++++- app/core/tests/test_api.py | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/core/api/serializers.py b/app/core/api/serializers.py index eccb3902..0d312c64 100644 --- a/app/core/api/serializers.py +++ b/app/core/api/serializers.py @@ -101,6 +101,8 @@ class Meta: class ProjectSerializer(serializers.ModelSerializer): """Used to retrieve project info""" + program_areas = serializers.StringRelatedField(many=True) + class Meta: model = Project fields = ( @@ -117,6 +119,7 @@ class Meta: "image_logo", "image_hero", "image_icon", + "program_areas", ) read_only_fields = ( "uuid", @@ -227,9 +230,11 @@ class Meta: class ProgramAreaSerializer(serializers.ModelSerializer): """Used to retrieve program_area info""" + projects = serializers.StringRelatedField(many=True) + class Meta: model = ProgramArea - fields = ("uuid", "name", "description", "image") + fields = ("uuid", "name", "description", "image", "projects") read_only_fields = ("uuid", "created_at", "updated_at") diff --git a/app/core/tests/test_api.py b/app/core/tests/test_api.py index d83c2ec1..2c34c36d 100644 --- a/app/core/tests/test_api.py +++ b/app/core/tests/test_api.py @@ -384,12 +384,15 @@ def test_create_soc_major(auth_client): assert res.data["title"] == payload["title"] -# def test_project_program_area_xref(auth_client, project, program_area): -# project.program_areas.add(program_area) -# project.save() - -# proj_res = auth_client.get(PROJECT_URL) -# program_area_res = auth_client.get(PROGRAM_AREA_URL) - -# assert filter(lambda proj: str(proj["uuid"]) == str(project.pk), proj_res.data) -# assert filter(lambda _sdg: str(_program_area["uuid"]) == str(program_area.pk), program_area_res) +def test_project_program_area_xref(auth_client, project, program_area): + project.program_areas.add(program_area) + project.save() + + proj_res = auth_client.get(PROJECT_URL) + program_area_res = auth_client.get(PROGRAM_AREA_URL) + + assert filter(lambda proj: str(proj["uuid"]) == str(project.pk), proj_res.data) + assert filter( + lambda _program_area: str(_program_area["uuid"]) == str(program_area.pk), + program_area_res, + ) From 2d2e2fd5c89213bd382f694f06824f8069b9cb16 Mon Sep 17 00:00:00 2001 From: del9ra Date: Thu, 31 Oct 2024 21:30:30 -0400 Subject: [PATCH 03/35] feat: add model: ProjectProgramAreaXref --- .../migrations/0028_project_program_areas.py | 20 ------ ...ctprogramareaxref_project_program_areas.py | 64 +++++++++++++++++++ app/core/migrations/max_migration.txt | 2 +- app/core/models.py | 7 +- app/core/tests/test_models.py | 40 ++++-------- 5 files changed, 85 insertions(+), 48 deletions(-) delete mode 100644 app/core/migrations/0028_project_program_areas.py create mode 100644 app/core/migrations/0028_projectprogramareaxref_project_program_areas.py diff --git a/app/core/migrations/0028_project_program_areas.py b/app/core/migrations/0028_project_program_areas.py deleted file mode 100644 index c8dea90f..00000000 --- a/app/core/migrations/0028_project_program_areas.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.2.11 on 2024-10-04 18:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0027_socmajor"), - ] - - operations = [ - migrations.AddField( - model_name="project", - name="program_areas", - field=models.ManyToManyField( - blank=True, related_name="projects", to="core.programarea" - ), - ), - ] diff --git a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py b/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py new file mode 100644 index 00000000..310737c0 --- /dev/null +++ b/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py @@ -0,0 +1,64 @@ +# Generated by Django 4.2.11 on 2024-10-31 22:55 + +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0027_socmajor"), + ] + + operations = [ + migrations.CreateModel( + name="ProjectProgramAreaXref", + fields=[ + ( + "uuid", + models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ( + "created_at", + models.DateTimeField(auto_now_add=True, verbose_name="Created at"), + ), + ( + "updated_at", + models.DateTimeField(auto_now=True, verbose_name="Updated at"), + ), + ( + "program_area_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="core.programarea", + ), + ), + ( + "project_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="core.project" + ), + ), + ], + options={ + "abstract": False, + }, + ), + migrations.AddField( + model_name="project", + name="program_areas", + field=models.ManyToManyField( + blank=True, + related_name="projects", + through="core.ProjectProgramAreaXref", + to="core.programarea", + ), + ), + ] diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index 56c2f06d..f8211fca 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0028_project_program_areas +0028_projectprogramareaxref_project_program_areas diff --git a/app/core/models.py b/app/core/models.py index 2260de28..a7428263 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -148,7 +148,7 @@ class Project(AbstractBaseModel): "ProgramArea", related_name="projects", blank=True, - # through="ProjectProgramAreaXref" + through="ProjectProgramAreaXref", ) def __str__(self): @@ -430,3 +430,8 @@ class SocMajor(AbstractBaseModel): def __str__(self): return self.title + + +class ProjectProgramAreaXref(AbstractBaseModel): + project_id = models.ForeignKey(Project, on_delete=models.CASCADE) + program_area_id = models.ForeignKey(ProgramArea, on_delete=models.CASCADE) diff --git a/app/core/tests/test_models.py b/app/core/tests/test_models.py index 1635de05..0438e445 100644 --- a/app/core/tests/test_models.py +++ b/app/core/tests/test_models.py @@ -4,7 +4,7 @@ from ..models import Event from ..models import ProgramArea -from ..models import Project +from ..models import ProjectProgramAreaXref pytestmark = pytest.mark.django_db @@ -150,30 +150,18 @@ def test_soc_major(soc_major): def test_project_program_area_relationship(project): - civic_tech_infrastructure_program_area = ProgramArea.objects.get( - name="Civic Tech Infrastructure" + workforce_development_program_area = ProgramArea.objects.get( + name="Workforce Development" ) - workforce_program_area = ProgramArea.objects.get(name="Workforce Development") - hack_for_la_project = Project.objects.create(name="Hack for LA Site") - hack_for_la_project.program_areas.add( - civic_tech_infrastructure_program_area, workforce_program_area + project.program_areas.add(workforce_development_program_area) + assert project.program_areas.count() == 1 + assert project.program_areas.contains(workforce_development_program_area) + assert workforce_development_program_area.projects.contains(project) + workforce_development_program_area_xref = ProjectProgramAreaXref.objects.get( + project_id=project, program_area_id=workforce_development_program_area ) - assert hack_for_la_project.program_areas.count() == 2 - assert hack_for_la_project.program_areas.contains( - civic_tech_infrastructure_program_area - ) - assert hack_for_la_project.program_areas.contains(workforce_program_area) - assert civic_tech_infrastructure_program_area.projects.contains(hack_for_la_project) - assert workforce_program_area.projects.contains(hack_for_la_project) - - hack_for_la_project.program_areas.remove(civic_tech_infrastructure_program_area) - assert hack_for_la_project.program_areas.count() == 1 - assert not hack_for_la_project.program_areas.contains( - civic_tech_infrastructure_program_area - ) - assert hack_for_la_project.program_areas.contains(workforce_program_area) - - assert not civic_tech_infrastructure_program_area.projects.contains( - hack_for_la_project - ) - assert workforce_program_area.projects.contains(hack_for_la_project) + assert workforce_development_program_area_xref.created_at is not None + project.program_areas.remove(workforce_development_program_area) + assert project.program_areas.count() == 0 + assert not workforce_development_program_area.projects.contains(project) + assert not project.program_areas.contains(workforce_development_program_area) From fe73d30a62c871b7ac4ac646daf3b1eb7270e567 Mon Sep 17 00:00:00 2001 From: del9ra Date: Thu, 31 Oct 2024 21:56:11 -0400 Subject: [PATCH 04/35] feat: update serializers and add relationship test --- app/core/tests/test_api.py | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/core/tests/test_api.py b/app/core/tests/test_api.py index 2c34c36d..f9a6cb41 100644 --- a/app/core/tests/test_api.py +++ b/app/core/tests/test_api.py @@ -18,11 +18,11 @@ FAQS_VIEWED_URL = reverse("faq-viewed-list") AFFILIATE_URL = reverse("affiliate-list") LOCATION_URL = reverse("location-list") -PROGRAM_AREA_URL = reverse("program-area-list") +PROGRAM_AREAS_URL = reverse("program-area-list") SKILL_URL = reverse("skill-list") STACK_ELEMENT_URL = reverse("stack-element-list") PERMISSION_TYPE = reverse("permission-type-list") -PROJECT_URL = reverse("project-list") +PROJECTS_URL = reverse("project-list") STACK_ELEMENT_TYPE_URL = reverse("stack-element-type-list") SDG_URL = reverse("sdg-list") AFFILIATION_URL = reverse("affiliation-list") @@ -259,7 +259,7 @@ def test_create_program_area(auth_client): "description": "About program area", "image": "http://www.imageurl.com", } - res = auth_client.post(PROGRAM_AREA_URL, payload) + res = auth_client.post(PROGRAM_AREAS_URL, payload) assert res.status_code == status.HTTP_201_CREATED assert res.data["name"] == payload["name"] @@ -272,9 +272,9 @@ def test_list_program_area(auth_client): "description": "About program area", "image": "http://www.imageurl.com", } - res = auth_client.post(PROGRAM_AREA_URL, payload) + res = auth_client.post(PROGRAM_AREAS_URL, payload) - res = auth_client.get(PROGRAM_AREA_URL) + res = auth_client.get(PROGRAM_AREAS_URL) program_areas = ProgramArea.objects.all() expected_data = ProgramAreaSerializer(program_areas, many=True).data @@ -385,14 +385,21 @@ def test_create_soc_major(auth_client): def test_project_program_area_xref(auth_client, project, program_area): - project.program_areas.add(program_area) - project.save() - - proj_res = auth_client.get(PROJECT_URL) - program_area_res = auth_client.get(PROGRAM_AREA_URL) + def get_object(objects, target_uuid): + for obj in objects: + if str(obj["uuid"]) == str(target_uuid): + return obj + return None - assert filter(lambda proj: str(proj["uuid"]) == str(project.pk), proj_res.data) - assert filter( - lambda _program_area: str(_program_area["uuid"]) == str(program_area.pk), - program_area_res, - ) + project.program_areas.add(program_area) + proj_res = auth_client.get(PROJECTS_URL) + test_proj = get_object(proj_res.data, project.uuid) + assert test_proj is not None + assert len(test_proj["program_areas"]) == 1 + assert program_area.name in test_proj["program_areas"] + + program_area_res = auth_client.get(PROGRAM_AREAS_URL) + test_program_ar = get_object(program_area_res.data, program_area.uuid) + assert test_program_ar is not None + assert len(test_program_ar["projects"]) == 1 + assert project.name in test_program_ar["projects"] From 58435edf3aa2ff9a914940f13601907081f1e7dc Mon Sep 17 00:00:00 2001 From: Bonnie Wolfe <37763229+ExperimentsInHonesty@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:51:22 -0700 Subject: [PATCH 05/35] Update issue templates --- .github/ISSUE_TEMPLATE/blank-issue.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/blank-issue.md b/.github/ISSUE_TEMPLATE/blank-issue.md index 998f844b..c9a6dfc9 100644 --- a/.github/ISSUE_TEMPLATE/blank-issue.md +++ b/.github/ISSUE_TEMPLATE/blank-issue.md @@ -2,7 +2,8 @@ name: Blank Issue about: Consistent formatting makes Issues concise and easy to navigate. title: '' -labels: '' +labels: 'complexity: missing, feature: missing, milestone: missing, points: missing, + role: missing, size: missing, stakeholder: missing' assignees: '' --- From eca0fd7a1635370d341b6aac55bb2125019f4f9d Mon Sep 17 00:00:00 2001 From: Bonnie Wolfe <37763229+ExperimentsInHonesty@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:54:27 -0700 Subject: [PATCH 06/35] Update issue templates --- ...t-logo-or-image-to-your-main-repository.md | 3 ++- ...e--cross-origin-destinations-are-unsafe.md | 20 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/lighthouse--cross-origin-destinations-are-unsafe.md diff --git a/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md b/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md index 3ceab1aa..d6707126 100644 --- a/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md +++ b/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md @@ -2,7 +2,8 @@ name: Add project logo or image to your main repository about: Simple action that will make it possible to add project to hackforla.org website title: '' -labels: enhancement +labels: 'complexity: medium, enhancement, feature: branding, milestone: missing, role: + product, s: PD team, size: 1pt' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/lighthouse--cross-origin-destinations-are-unsafe.md b/.github/ISSUE_TEMPLATE/lighthouse--cross-origin-destinations-are-unsafe.md deleted file mode 100644 index a9418826..00000000 --- a/.github/ISSUE_TEMPLATE/lighthouse--cross-origin-destinations-are-unsafe.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: 'Lighthouse: Cross-origin destinations are unsafe' -about: Instructions for addressing the cross-origin linking vulnerabilities -title: 'Lighthouse Issue: Cross-origin destinations are unsafe' -labels: '' -assignees: '' - ---- - -### Overview - -Links to cross-origin destinations are unsafe both from a security and performance perspective. - -### Action Item - -Run [Lighthouse](https://developers.google.com/web/tools/lighthouse/) and then follow the instructions in [cross-origin destinations are unsafe](https://developers.google.com/web/tools/lighthouse/audits/noopener). - -## Summary of instructions - -When using *target=\_blank* also adding *rel="noopener"* to the tag ensures that new page runs in a separate process. From d42a2281eb788f725fd781a7172a85038c9da7ee Mon Sep 17 00:00:00 2001 From: Ethan Strominger Date: Mon, 7 Oct 2024 20:01:10 -0400 Subject: [PATCH 07/35] Issue 403 make project optional for user_permissions --- app/core/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/core/models.py b/app/core/models.py index a7428263..722bca1a 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -308,7 +308,9 @@ class UserPermission(AbstractBaseModel): practice_area = models.ForeignKey( PracticeArea, on_delete=models.CASCADE, blank=True, null=True ) - project = models.ForeignKey(Project, on_delete=models.CASCADE) + project = models.ForeignKey( + Project, blank=True, null=True, on_delete=models.CASCADE + ) class Meta: constraints = [ From 16f78feb05548eed82c5b107d28419bf5fe0c634 Mon Sep 17 00:00:00 2001 From: Ethan Strominger Date: Mon, 7 Oct 2024 20:15:43 -0400 Subject: [PATCH 08/35] Migration scripts --- .../0028_alter_userpermission_project.py | 24 +++++++++++++++++++ app/core/migrations/max_migration.txt | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/core/migrations/0028_alter_userpermission_project.py diff --git a/app/core/migrations/0028_alter_userpermission_project.py b/app/core/migrations/0028_alter_userpermission_project.py new file mode 100644 index 00000000..7e54a092 --- /dev/null +++ b/app/core/migrations/0028_alter_userpermission_project.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.11 on 2024-09-24 18:46 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0027_socmajor"), + ] + + operations = [ + migrations.AlterField( + model_name="userpermission", + name="project", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="core.project", + ), + ), + ] diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index f8211fca..aa318cff 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0028_projectprogramareaxref_project_program_areas +0028_alter_userpermission_project From 1a998e74b392250a5fcd6813de02298b6974802c Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 5 Sep 2024 15:47:48 -0700 Subject: [PATCH 09/35] update Docker syntax - compose file no longer uses versioning - Dockerfile env vars use = signs --- app/Dockerfile | 4 ++-- docker-compose.yml | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 056908ab..52f9df7d 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -5,8 +5,8 @@ FROM python:3.10-alpine WORKDIR /usr/src/app # set environment variables -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 ENV PYTHONPYCACHEPREFIX=/root/.cache/pycache/ # install system dependencies diff --git a/docker-compose.yml b/docker-compose.yml index 69e78df8..824ad038 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: web: build: ./app From 5d9d21f0e07eadd329f770bfd76aa3d0a773e8cd Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 19 Sep 2024 13:08:17 -0700 Subject: [PATCH 10/35] scripts: add rebase_migration script --- scripts/rebase_migration.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/rebase_migration.sh diff --git a/scripts/rebase_migration.sh b/scripts/rebase_migration.sh new file mode 100755 index 00000000..5ee06e80 --- /dev/null +++ b/scripts/rebase_migration.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +set -x +docker-compose exec web python manage.py rebase_migration core From 8849aad7f2f33ae2af4cfa0b2dee6b0a4a3e62b9 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Tue, 23 Jul 2024 01:26:06 -0700 Subject: [PATCH 11/35] split CONTRIBUTING.md into smaller files --- CONTRIBUTING.md | 434 --------------------------- docs/.pages | 4 +- docs/contributing/.pages | 7 + docs/contributing/dev_environment.md | 166 ++++++++++ docs/contributing/documentation.md | 5 + docs/contributing/git.md | 35 +++ docs/contributing/issues.md | 163 ++++++++++ docs/contributing/team.md | 8 + docs/tools/docker.md | 38 +++ docs/tools/index.md | 12 + 10 files changed, 435 insertions(+), 437 deletions(-) create mode 100644 docs/contributing/.pages create mode 100644 docs/contributing/dev_environment.md create mode 100644 docs/contributing/documentation.md create mode 100644 docs/contributing/git.md create mode 100644 docs/contributing/issues.md create mode 100644 docs/contributing/team.md create mode 100644 docs/tools/index.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a03d90cb..24f641e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,437 +3,3 @@ Thank you for volunteering your time! The following is a set of guidelines for contributing to the peopledepot repository, which is hosted on GitHub. **Please make sure you have completed the onboarding process which includes joining the Hack for LA Slack, GitHub, and Google Drive. If you have not been onboarded, see the [Getting Started Page](https://www.hackforla.org/getting-started).** _Workshop attendees are granted a temporary exception from this requirement._ - -## 1. Joining Repository Team - -This step is optional if this is your first time fixing an issue and you want to try fixing an issue without this step. - -In the `people-depot` Slack channel, send an introductory message with your GitHub handle/username asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma. - -!!! note "Please do the following once you have accepted the GitHub invite (comes via email or in your GitHub notifications)" - Make your own Hack for LA GitHub organization membership public by following this [guide](https://help.github.com/en/articles/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership). - -## 2. Setting Up Development Environment - -### 2.1 Pre-requisites - -#### 2.1.1 GitHub account - -See [here](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account#signing-up-for-a-new-account) for creating a GitHub account. If you are not familiar with Git, [this tutorial](https://docs.github.com/en/get-started/quickstart/hello-world) is recommended. - -#### 2.1.2 Two-factor authentication - -Set up two-factor authentication on your account by following this [guide](https://docs.github.com/en/github/authenticating-to-github/configuring-two-factor-authentication). - -#### 2.1.3 Text editor - -[VS Code](https://code.visualstudio.com/download) is recommended, but feel free to use a text editor of your choice. - -#### 2.1.4 Install Git - -Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system [**here**](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). - -=== "Windows" - - we recommend [installing Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/remote/wsl). WSL provides a Linux-compatible environment that can prevent common errors during script execution. - - - After setting up WSL, install Git directly from the Linux terminal. This method can help avoid complications that sometimes arise when using Git Bash on Windows. - - - If you prefer Git Bash or encounter errors related to line endings when running scripts, the problem might be due to file conversions in Windows. To address this, configure Git as follows: - - ```bash - git config --system set autocrlf=false - ``` - - !!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you encounter any errors while running scripts on Windows" - -=== "Mac" - Please note that if you have a Mac the page offers several options (see other option, if you need to conserve hard drive space) including: - - - an “easiest” option (this version is fine for our use): This option would take just over 4GB. - - a “more up to date” option (not required but optional if you want it): This option prompts you to go to install an 8GB package manager called Homebrew. - - Other option: If your computer is low on space, you can use this [tutorial](https://www.datacamp.com/community/tutorials/homebrew-install-use) to install XCode Command Tools and a lighter version of Homebrew and then install Git using this command: `$ brew install git` which in total only uses 300MB. - -#### 2.1.5 Install Docker - -Install or make sure [docker][docker-install] and [docker-compose][docker-compose-install] are installed on your computer - -```bash -docker -v -docker-compose -v -``` - -The recommended installation method for your operating system can be found [here](https://docs.docker.com/install/). - -!!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you have trouble installing docker on your system" - -More on using Docker and the concepts of containerization: - -- [Get started with Docker](https://docs.docker.com/get-started/) - -### 2.2 Fork the repository - -You can fork the hackforla/peopledepot repository by clicking -. A fork is a copy of the repository that will be placed on your GitHub account. - -!!! note "It should create a URL that looks like the following -> `https://github.com//peopledepot`" - !!! example "For example -> `https://github.com/octocat/peopledepot`" - -!!! info "What you have created is a forked copy in a remote version on GitHub. It is not on your local machine yet" - -#### 2.2.1 Clone a copy on your computer - -The following steps will clone (create) a local copy of the forked repository on your computer. - -1. Create a new folder in your computer that will contain `hackforla` projects. - - In your command line interface (Terminal, Git Bash, Powershell), move to where you want your new folder to be placed and create a new folder in your computer that will contain `hackforla` projects. After that, navigate into the folder(directory) you just created. - - For example: - - ```bash - cd /projects - mkdir hackforla - cd hackforla - ``` - -1. From the hackforla directory created in previous section: - - ```bash - git clone https://github.com//peopledepot.git - ``` - - For example if your GitHub username was `octocat`: - - ```bash - git clone https://github.com/octocat/peopledepot.git - ``` - - !!! note "You can also clone using ssh which is more secure but requires more setup. Because of the additional setup, cloning using https as shown above is recommended" - -You should now have a new folder in your `hackforla` folder called `peopledepot`. Verify this by changing into the new directory: - -```bash -cd peopledepot -``` - -#### 2.2.2 Verify and set up remote references - -Verify that your local cloned repository is pointing to the correct `origin` URL (that is, the forked repo on your own GitHub account): - -```bash -git remote -v -``` - -You should see `fetch` and `push` URLs with links to your forked repository under your account (i.e. `https://github.com//peopledepot.git`). You are all set to make working changes to the project on your local machine. - -However, we still need a way to keep our local repo up to date with the deployed project. To do so, you must add an upstream remote to incorporate changes made while you are working on your local repo. Run the following to add an upstream remote URL & update your local repo with recent changes to the `hackforla` version: - -```bash -git remote add upstream https://github.com/hackforla/peopledepot.git -git fetch upstream -``` - -After adding the upstream remote, you should now see it if you again run `git remote -v` : - -```bash -origin https://github.com//peopledepot.git (fetch) -origin https://github.com//peopledepot.git (push) -upstream https://github.com/hackforla/peopledepot.git (fetch) -upstream https://github.com/hackforla/peopledepot.git (push) -``` - -### 2.3 Build and run using Docker locally - -1. Make sure the Docker service is running - - === "Docker (Engine)" - ```bash - sudo systemctl status docker - ``` - - It will show `Active: active (running)` if it's running. - - === "Docker Desktop" - 1. Start Docker Desktop - 1. Run `docker container ls` to verify Docker Desktop is running. If it is not running you will get the message: `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?` - -1. Create an .env.docker file from .env.docker-example - - ```bash - cp ./app/.env.docker-example ./app/.env.docker - ``` - -1. Build and run the project via the script (this includes running `docker-compose up`) - - ```bash - ./scripts/buildrun.sh - ``` - -1. Create a super user for logging into the web admin interface - - ```bash - docker-compose exec web python manage.py createsuperuser --no-input - ``` - -1. Browse to the web admin interface at `http://localhost:8000/admin/` and confirm the admin site is running. Use DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD from .env.docker for credentials. - -## 3. Managing Docker - -### 3.1 Stopping Docker - -To stop the service-container, but not destroy it (often sufficient for day-to-day work): - -```bash -docker-compose stop -``` - -To stop and destroy the service container: - -```bash -docker-compose down -``` - -Add the `-v` flag to destroy the data volumes as well: - -```bash -docker-compose down -v -``` - -### 3.2 Recycling / Refreshing Database - -To restore a database to its original state and remove any data manually added, delete the container and image. -From Docker: - -=== "Terminal" - ```bash - docker-compose down -v - ``` - -=== "Docker Desktop" - 1. Open Containers section - 1. Delete people-db-1 container - 1. Open Images Tab - 1. Remove djangorestapipostrgresql image - -## 4. Fixing Issues - -### 4.1 Find an issue - -Find an issue in Prioritized Backlog [here](https://github.com/hackforla/peopledepot/projects/1#column-16900748) - -If you joined the peopledepot repository as described in a previous section: - -1. Assign the issue to yourself and move it to "In progress" column. -1. Follow the steps in the issue description to complete the issue. -1. Make sure to comment your ETA and Availability when you first assign yourself. - -If you don't have privileges, add a comment that you are working on the issue. - -### 4.2 Create a new branch - -Once you have selected an issue to work on, create a branch for that issue. - -Verify you are on the `main` branch. - -```bash -git branch -``` - -You will see a list of all of your branches. There will be a star (`*`) next to the branch that you are currently in. By default you should start on the `main` branch. - -If you are not currently in the `main` branch, run the following command to return to it: - -```bash -git checkout main -``` - -```bash -git pull origin main -``` - -This ensures you have the most recent code, which is important if you previously cloned and it has been more than a day. - -Create a new branch where you will work on the issue. The branch name should include the issue number. For example, to create a new branch for issue 15 and change into it: - -```bash -git checkout -b -15 -``` - -### 4.3 Make changes - -Make changes to fix the issue. If creating a new table or API, read [Add Model and API End Points](how-to/add-model-and-api-endpoints.md). - -### 4.4 Pull to get the most recent code - -You can probably skip this if you fix the issue on the same day that you pulled the code. - -```bash -git pull -``` - -!!! note "If you are using Visual studios code you can use the Git graphical user interface to stage your changes. For instructions check out the [Git GUI page in the website Wiki]()" - -### 4.5 Add changed files to staging - -**Make sure you are on your issue branch (instead of `main`)** - -```bash -git branch -``` - -You must add your files to the staging area before you can commit (save them to git). - -Run this command if you want to **add changes from a specific file to your commit record**: - -```bash -git add “filename.ext” -``` - -Run this command if you want to **add all changes to all file(s) to your commit record**: - -```bash -git add . -``` - -### 4.6 Check Git status - -This command will list the files that have been staged with green text. These are the files that will be committed (saved) when you run the next command, `git commit`. Please be sure all your staged changes are relevant to the issue you are working on. If you accidentally included unrelated changes, please unstage them before making this commit, and then make a new commit for the unrelated changes. (The commands for unstaging commits are provided in the output of your `git status` command.) - -```bash -git status -``` - -### 4.7 Remove files that you don't want staged - -This command will unstage a file that you don't want included in the commit. The specified file will not be committed (saved) when you run the next command, `git commit`. This only works if the wrong files were added, but they were not yet committed. (See [this tutorial](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) for an in-depth discussion.) The file will be removed from the staging area, but not actually deleted: - -```bash -git reset HEAD “filename.ext” -``` - -### 4.8 Install pre-commit - -This will check your changes for common problems. - -See the [Pre-commit page](tools/pre-commit.md) for installation instructions. - -For consistency, an automated bot will perform the same checks on the repository side when you open a pull request. - -### 4.9 Commit staged changes - -This command saves your work, and prepares it to push to your repository. Use the `-m` flag to quickly add a message to your commit. Your message should be a short description of the changes you made. It will be extremely helpful if other people can understand your message, so try to resist the temptation to be overly cryptic. - -To commit your changes with a message, run: - -```bash -git commit -m “insert message here” -``` - -Ensure that your local repository is up-to-date with the main site: - -```bash -git pull upstream -``` - -You can also sync your fork directly on GitHub by clicking "Sync Fork" at the right of the screen and then clicking "Update Branch" - -### 4.10 Push to upstream origin (aka, your fork) - -Push your local branch to your remote repository: - -```bash -git push --set-upstream origin -``` - -Alternatively, you can run - -```bash -git push -``` - -### 4.11 Create a pull request - -#### 4.11.1 Push all changes in your issue branch - -Once you are satisfied with your changes, push them to the feature branch you made within your remote repository. - -```bash -git push --set-upstream origin -``` - -#### 4.11.2 Complete pull request from GitHub - -1. Click the green button to create a Pull Request (PR) -1. Add a short title in the subject line -1. In the body of the comment, add the following, replacing `` with the issue you worked on: - -```bash -fixes # -``` - -1. Below this, add a brief description of the changes you made -1. Click the green "Create pull request" button -1. Add the PR to the project board - -## 5. Documentation - -We highly encourage contributors to add and update documentation in the same pull request as the code. This will ensure that the docs and features are synchronized. - -Please see the [MkDocs page](tools/mkdocs.md) for how to view documentation changes locally using the mkdocs in docker. - -## 6. Sync Main Changes - -Your fork of this repository on GitHub, and your local clone of that fork, will get out of sync with the (upstream) repository as others update the repository. (That's what has happened when you see something like "This branch is 1 commit behind peopledepot:main" on your forked repository.) - -One way to keep your fork up to date with this repository is to follow these instruction: [Syncing your fork to the original repository via the browser](https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser) - -You can also update your fork via the local clone of your fork, using these instructions. Assuming you have a local clone with remotes `upstream` (this repo) and `origin` (your GitHub fork of this repo): - -- First, you will need to create a local branch which tracks upstream/main. You will only need to do this once; you do not need to do this every time you want to incorporate upstream changes. - -Run the following two commands: - -```bash -git fetch upstream -git checkout -b upstream-main --track upstream/main -``` - -If you have already created the branch upstream-main, the following commands will incorporate upstream changes: - -```bash -git checkout upstream-main # Move to the branch you want to merge with. -git pull # This updates your tracking branch to match the main branch in this repository -git checkout main # Move back to your main branch -git merge upstream-main # Merge to bring your main current. -``` - -If you do all your work on topic branches (as suggested above) and keep main free of local modifications, this merge should apply cleanly. - -Then push the merge changes to your GitHub fork: - -```bash -git push -``` - -If you go to your online GitHub repository this should remove the message "This branch is x commit behind peopledepot:main". - -## 7. Creating Issues - -To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link. - -# Appendix - -## A. Submitting Bugs for Third Party Packages / Apps - -You can go to these links and submit an issue: - -- [Docker](https://github.com/docker) -- [Flake8][flake8-docs] -- [Black][black-docs] -- [isort][isort-docs] - -[black-docs]: https://github.com/psf/black -[docker-compose-install]: https://docs.docker.com/compose/install/ -[docker-install]: https://docs.docker.com/get-docker/ -[flake8-docs]: https://github.com/pycqa/flake8 -[isort-docs]: https://github.com/pycqa/isort/ diff --git a/docs/.pages b/docs/.pages index 0e1a6421..eee111df 100644 --- a/docs/.pages +++ b/docs/.pages @@ -1,11 +1,9 @@ nav: - index.md - - Get Started: - - CONTRIBUTING.md - architecture - ref - howto - how-to - tools - - ... + - contributing - license.md diff --git a/docs/contributing/.pages b/docs/contributing/.pages new file mode 100644 index 00000000..b7f0c70c --- /dev/null +++ b/docs/contributing/.pages @@ -0,0 +1,7 @@ +nav: + - team.md + - dev_environment.md + - issues.md + - git.md + - documentation.md + - ... diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md new file mode 100644 index 00000000..d358ce60 --- /dev/null +++ b/docs/contributing/dev_environment.md @@ -0,0 +1,166 @@ +## 2. Setting Up Development Environment + +### 2.1 Pre-requisites + +#### 2.1.1 GitHub account + +See [here](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account#signing-up-for-a-new-account) for creating a GitHub account. If you are not familiar with Git, [this tutorial](https://docs.github.com/en/get-started/quickstart/hello-world) is recommended. + +#### 2.1.2 Two-factor authentication + +Set up two-factor authentication on your account by following this [guide](https://docs.github.com/en/github/authenticating-to-github/configuring-two-factor-authentication). + +#### 2.1.3 Text editor + +[VS Code](https://code.visualstudio.com/download) is recommended, but feel free to use a text editor of your choice. + +#### 2.1.4 Install Git + +Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system [**here**](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). + +=== "Windows" + - we recommend [installing Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/remote/wsl). WSL provides a Linux-compatible environment that can prevent common errors during script execution. + + - After setting up WSL, install Git directly from the Linux terminal. This method can help avoid complications that sometimes arise when using Git Bash on Windows. + + - If you prefer Git Bash or encounter errors related to line endings when running scripts, the problem might be due to file conversions in Windows. To address this, configure Git as follows: + + ```bash + git config --system set autocrlf=false + ``` + + !!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you encounter any errors while running scripts on Windows" + +=== "Mac" + Please note that if you have a Mac the page offers several options (see other option, if you need to conserve hard drive space) including: + + - an “easiest” option (this version is fine for our use): This option would take just over 4GB. + - a “more up to date” option (not required but optional if you want it): This option prompts you to go to install an 8GB package manager called Homebrew. + - Other option: If your computer is low on space, you can use this [tutorial](https://www.datacamp.com/community/tutorials/homebrew-install-use) to install XCode Command Tools and a lighter version of Homebrew and then install Git using this command: `$ brew install git` which in total only uses 300MB. + +#### 2.1.5 Install Docker + +Install or make sure [docker][docker-install] and [docker-compose][docker-compose-install] are installed on your computer + +```bash +docker -v +docker-compose -v +``` + +The recommended installation method for your operating system can be found [here](https://docs.docker.com/install/). + +!!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you have trouble installing docker on your system" + +More on using Docker and the concepts of containerization: + +- [Get started with Docker](https://docs.docker.com/get-started/) + +### 2.2 Fork the repository + +You can fork the hackforla/peopledepot repository by clicking +. A fork is a copy of the repository that will be placed on your GitHub account. + +!!! note "It should create a URL that looks like the following -> `https://github.com//peopledepot`" + !!! example "For example -> `https://github.com/octocat/peopledepot`" + +!!! info "What you have created is a forked copy in a remote version on GitHub. It is not on your local machine yet" + +#### 2.2.1 Clone a copy on your computer + +The following steps will clone (create) a local copy of the forked repository on your computer. + +1. Create a new folder in your computer that will contain `hackforla` projects. + + In your command line interface (Terminal, Git Bash, Powershell), move to where you want your new folder to be placed and create a new folder in your computer that will contain `hackforla` projects. After that, navigate into the folder(directory) you just created. + + For example: + + ```bash + cd /projects + mkdir hackforla + cd hackforla + ``` + +1. From the hackforla directory created in previous section: + + ```bash + git clone https://github.com//peopledepot.git + ``` + + For example if your GitHub username was `octocat`: + + ```bash + git clone https://github.com/octocat/peopledepot.git + ``` + + !!! note "You can also clone using ssh which is more secure but requires more setup. Because of the additional setup, cloning using https as shown above is recommended" + +You should now have a new folder in your `hackforla` folder called `peopledepot`. Verify this by changing into the new directory: + +```bash +cd peopledepot +``` + +#### 2.2.2 Verify and set up remote references + +Verify that your local cloned repository is pointing to the correct `origin` URL (that is, the forked repo on your own GitHub account): + +```bash +git remote -v +``` + +You should see `fetch` and `push` URLs with links to your forked repository under your account (i.e. `https://github.com//peopledepot.git`). You are all set to make working changes to the project on your local machine. + +However, we still need a way to keep our local repo up to date with the deployed project. To do so, you must add an upstream remote to incorporate changes made while you are working on your local repo. Run the following to add an upstream remote URL & update your local repo with recent changes to the `hackforla` version: + +```bash +git remote add upstream https://github.com/hackforla/peopledepot.git +git fetch upstream +``` + +After adding the upstream remote, you should now see it if you again run `git remote -v` : + +```bash +origin https://github.com//peopledepot.git (fetch) +origin https://github.com//peopledepot.git (push) +upstream https://github.com/hackforla/peopledepot.git (fetch) +upstream https://github.com/hackforla/peopledepot.git (push) +``` + +### 2.3 Build and run using Docker locally + +1. Make sure the Docker service is running + + === "Docker (Engine)" + ```bash + sudo systemctl status docker + ``` + + It will show `Active: active (running)` if it's running. + + === "Docker Desktop" + 1. Start Docker Desktop + 1. Run `docker container ls` to verify Docker Desktop is running. If it is not running you will get the message: `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?` + +1. Create an .env.docker file from .env.docker-example + + ```bash + cp ./app/.env.docker-example ./app/.env.docker + ``` + +1. Build and run the project via the script (this includes running `docker-compose up`) + + ```bash + ./scripts/buildrun.sh + ``` + +1. Create a super user for logging into the web admin interface + + ```bash + docker-compose exec web python manage.py createsuperuser --no-input + ``` + +1. Browse to the web admin interface at `http://localhost:8000/admin/` and confirm the admin site is running. Use DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD from .env.docker for credentials. + +[docker-compose-install]: https://docs.docker.com/compose/install/ +[docker-install]: https://docs.docker.com/get-docker/ diff --git a/docs/contributing/documentation.md b/docs/contributing/documentation.md new file mode 100644 index 00000000..3e6f3058 --- /dev/null +++ b/docs/contributing/documentation.md @@ -0,0 +1,5 @@ +## 5. Documentation + +We highly encourage contributors to add and update documentation in the same pull request as the code. This will ensure that the docs and features are synchronized. + +Please see the [MkDocs page](tools/mkdocs.md) for how to view documentation changes locally using the mkdocs in docker. diff --git a/docs/contributing/git.md b/docs/contributing/git.md new file mode 100644 index 00000000..ff0d62c8 --- /dev/null +++ b/docs/contributing/git.md @@ -0,0 +1,35 @@ +## 6. Sync Main Changes + +Your fork of this repository on GitHub, and your local clone of that fork, will get out of sync with the (upstream) repository as others update the repository. (That's what has happened when you see something like "This branch is 1 commit behind peopledepot:main" on your forked repository.) + +One way to keep your fork up to date with this repository is to follow these instruction: [Syncing your fork to the original repository via the browser](https://github.com/KirstieJane/STEMMRoleModels/wiki/Syncing-your-fork-to-the-original-repository-via-the-browser) + +You can also update your fork via the local clone of your fork, using these instructions. Assuming you have a local clone with remotes `upstream` (this repo) and `origin` (your GitHub fork of this repo): + +- First, you will need to create a local branch which tracks upstream/main. You will only need to do this once; you do not need to do this every time you want to incorporate upstream changes. + +Run the following two commands: + +```bash +git fetch upstream +git checkout -b upstream-main --track upstream/main +``` + +If you have already created the branch upstream-main, the following commands will incorporate upstream changes: + +```bash +git checkout upstream-main # Move to the branch you want to merge with. +git pull # This updates your tracking branch to match the main branch in this repository +git checkout main # Move back to your main branch +git merge upstream-main # Merge to bring your main current. +``` + +If you do all your work on topic branches (as suggested above) and keep main free of local modifications, this merge should apply cleanly. + +Then push the merge changes to your GitHub fork: + +```bash +git push +``` + +If you go to your online GitHub repository this should remove the message "This branch is x commit behind peopledepot:main". diff --git a/docs/contributing/issues.md b/docs/contributing/issues.md new file mode 100644 index 00000000..3a97a527 --- /dev/null +++ b/docs/contributing/issues.md @@ -0,0 +1,163 @@ +## 4. Fixing Issues + +### 4.1 Find an issue + +Find an issue in Prioritized Backlog [here](https://github.com/hackforla/peopledepot/projects/1#column-16900748) + +If you joined the peopledepot repository as described in a previous section: + +1. Assign the issue to yourself and move it to "In progress" column. +1. Follow the steps in the issue description to complete the issue. +1. Make sure to comment your ETA and Availability when you first assign yourself. + +If you don't have privileges, add a comment that you are working on the issue. + +### 4.2 Create a new branch + +Once you have selected an issue to work on, create a branch for that issue. + +Verify you are on the `main` branch. + +```bash +git branch +``` + +You will see a list of all of your branches. There will be a star (`*`) next to the branch that you are currently in. By default you should start on the `main` branch. + +If you are not currently in the `main` branch, run the following command to return to it: + +```bash +git checkout main +``` + +```bash +git pull origin main +``` + +This ensures you have the most recent code, which is important if you previously cloned and it has been more than a day. + +Create a new branch where you will work on the issue. The branch name should include the issue number. For example, to create a new branch for issue 15 and change into it: + +```bash +git checkout -b -15 +``` + +### 4.3 Make changes + +Make changes to fix the issue. + +### 4.4 Pull to get the most recent code + +You can probably skip this if you fix the issue on the same day that you pulled the code. + +```bash +git pull +``` + +!!! note "If you are using Visual studios code you can use the Git graphical user interface to stage your changes. For instructions check out the [Git GUI page in the website Wiki]()" + +### 4.5 Add changed files to staging + +**Make sure you are on your issue branch (instead of `main`)** + +```bash +git branch +``` + +You must add your files to the staging area before you can commit (save them to git). + +Run this command if you want to **add changes from a specific file to your commit record**: + +```bash +git add “filename.ext” +``` + +Run this command if you want to **add all changes to all file(s) to your commit record**: + +```bash +git add . +``` + +### 4.6 Check Git status + +This command will list the files that have been staged with green text. These are the files that will be committed (saved) when you run the next command, `git commit`. Please be sure all your staged changes are relevant to the issue you are working on. If you accidentally included unrelated changes, please unstage them before making this commit, and then make a new commit for the unrelated changes. (The commands for unstaging commits are provided in the output of your `git status` command.) + +```bash +git status +``` + +### 4.7 Remove files that you don't want staged + +This command will unstage a file that you don't want included in the commit. The specified file will not be committed (saved) when you run the next command, `git commit`. This only works if the wrong files were added, but they were not yet committed. (See [this tutorial](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) for an in-depth discussion.) The file will be removed from the staging area, but not actually deleted: + +```bash +git reset HEAD “filename.ext” +``` + +### 4.8 Install pre-commit + +This will check your changes for common problems. + +See the [Pre-commit page](tools/pre-commit.md) for installation instructions. + +For consistency, an automated bot will perform the same checks on the repository side when you open a pull request. + +### 4.9 Commit staged changes + +This command saves your work, and prepares it to push to your repository. Use the `-m` flag to quickly add a message to your commit. Your message should be a short description of the changes you made. It will be extremely helpful if other people can understand your message, so try to resist the temptation to be overly cryptic. + +To commit your changes with a message, run: + +```bash +git commit -m “insert message here” +``` + +Ensure that your local repository is up-to-date with the main site: + +```bash +git pull upstream +``` + +You can also sync your fork directly on GitHub by clicking "Sync Fork" at the right of the screen and then clicking "Update Branch" + +### 4.10 Push to upstream origin (aka, your fork) + +Push your local branch to your remote repository: + +```bash +git push --set-upstream origin +``` + +Alternatively, you can run + +```bash +git push +``` + +### 4.11 Create a pull request + +#### 4.11.1 Push all changes in your issue branch + +Once you are satisfied with your changes, push them to the feature branch you made within your remote repository. + +```bash +git push --set-upstream origin +``` + +#### 4.11.2 Complete pull request from GitHub + +1. Click the green button to create a Pull Request (PR) +1. Add a short title in the subject line +1. In the body of the comment, add the following, replacing `` with the issue you worked on: + +```bash +fixes # +``` + +1. Below this, add a brief description of the changes you made +1. Click the green "Create pull request" button +1. Add the PR to the project board + +## 7. Creating Issues + +To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link. diff --git a/docs/contributing/team.md b/docs/contributing/team.md new file mode 100644 index 00000000..eb764ce6 --- /dev/null +++ b/docs/contributing/team.md @@ -0,0 +1,8 @@ +## 1. Joining Repository Team + +This step is optional if this is your first time fixing an issue and you want to try fixing an issue without this step. + +In the `people-depot` Slack channel, send an introductory message with your GitHub handle/username asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma. + +!!! note "Please do the following once you have accepted the GitHub invite (comes via email or in your GitHub notifications)" + Make your own Hack for LA GitHub organization membership public by following this [guide](https://help.github.com/en/articles/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership). diff --git a/docs/tools/docker.md b/docs/tools/docker.md index ac49299e..a96c6949 100644 --- a/docs/tools/docker.md +++ b/docs/tools/docker.md @@ -1,5 +1,43 @@ # Docker +## 3. Managing Docker + +### 3.1 Stopping Docker + +To stop the service-container, but not destroy it (often sufficient for day-to-day work): + +```bash +docker-compose stop +``` + +To stop and destroy the service container: + +```bash +docker-compose down +``` + +Add the `-v` flag to destroy the data volumes as well: + +```bash +docker-compose down -v +``` + +### 3.2 Recycling / Refreshing Database + +To restore a database to its original state and remove any data manually added, delete the container and image. +From Docker: + +=== "Terminal" + ```bash + docker-compose down -v + ``` + +=== "Docker Desktop" + 1. Open Containers section + 1. Delete people-db-1 container + 1. Open Images Tab + 1. Remove djangorestapipostrgresql image + ## Cache mount This helps speed up subsequent docker builds by caching intermediate files and reusing them across builds. It's available with docker buildkit. The key here is to disable anything that could delete the cache, because we want to preserve it. The cache mount is not going to end up in the docker image being built, so there's no concern about disk space usage. diff --git a/docs/tools/index.md b/docs/tools/index.md new file mode 100644 index 00000000..a8f21cef --- /dev/null +++ b/docs/tools/index.md @@ -0,0 +1,12 @@ +## A. Submitting Bugs for Third Party Packages / Apps + +You can go to these links and submit an issue: + +- [Docker](https://github.com/docker) +- [Flake8][flake8-docs] +- [Black][black-docs] +- [isort][isort-docs] + +[black-docs]: https://github.com/psf/black +[flake8-docs]: https://github.com/pycqa/flake8 +[isort-docs]: https://github.com/pycqa/isort/ From 06744393b6ac79016cd57dd9974929770387f091 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 3 Oct 2024 10:12:30 -0700 Subject: [PATCH 12/35] move docker section into tools/docker.md --- docs/tools/docker.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tools/docker.md b/docs/tools/docker.md index a96c6949..a4a396fa 100644 --- a/docs/tools/docker.md +++ b/docs/tools/docker.md @@ -1,8 +1,8 @@ # Docker -## 3. Managing Docker +## Managing Docker -### 3.1 Stopping Docker +### Stopping Docker To stop the service-container, but not destroy it (often sufficient for day-to-day work): @@ -22,7 +22,7 @@ Add the `-v` flag to destroy the data volumes as well: docker-compose down -v ``` -### 3.2 Recycling / Refreshing Database +### Recycling / Refreshing Database To restore a database to its original state and remove any data manually added, delete the container and image. From Docker: From e83cbe3de0b330a6b06effd0f6299ce6e3093aed Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Fri, 26 Jul 2024 11:41:31 -0700 Subject: [PATCH 13/35] split CONTRIBUTING.md from contributing/index.md CONTRIBUTING.md will be a simplified page that links to the mkdocs contributing page. --- .pre-commit-config.yaml | 1 - CONTRIBUTING.md | 10 ++++++++-- README.md | 2 +- docs/CONTRIBUTING.md | 1 - docs/contributing/index.md | 19 +++++++++++++++++++ 5 files changed, 28 insertions(+), 5 deletions(-) delete mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/contributing/index.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15979dcb..2f7d220f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -141,7 +141,6 @@ repos: exclude: | (?x)^( .github/ISSUE_TEMPLATE/| - docs/CONTRIBUTING.md$| docs/index.md$| docs/license.md$ ) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24f641e5..7469b143 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,11 @@ # Contributing -Thank you for volunteering your time! The following is a set of guidelines for contributing to the peopledepot repository, which is hosted on GitHub. +Thank you for volunteering your time! -**Please make sure you have completed the onboarding process which includes joining the Hack for LA Slack, GitHub, and Google Drive. If you have not been onboarded, see the [Getting Started Page](https://www.hackforla.org/getting-started).** _Workshop attendees are granted a temporary exception from this requirement._ +Here are the recommended steps for contributing: + +1. Join the team +1. Take an issue +1. Fork, modify, and submit pull request + +Please see the [contributing section](http://hackforla.github.io/peopledepot/contributing/) for more information. diff --git a/README.md b/README.md index 19748e89..e4af24dc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ This repository uses the [GNU General Public License (v2.0)][licensing]. -[contributing]: ./CONTRIBUTING.md +[contributing]: http://hackforla.github.io/peopledepot/contributing/ [django-docs]: https://docs.djangoproject.com/ [docker-docs]: https://www.postgresql.org/docs/ [drf-docs]: https://www.django-rest-framework.org/tutorial/quickstart/ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md deleted file mode 100644 index ea38c9bf..00000000 --- a/docs/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "CONTRIBUTING.md" diff --git a/docs/contributing/index.md b/docs/contributing/index.md new file mode 100644 index 00000000..ac7f69e9 --- /dev/null +++ b/docs/contributing/index.md @@ -0,0 +1,19 @@ +# Contributing + +Thank you for volunteering your time! The following is a set of guidelines for contributing to the peopledepot repository, which is hosted on GitHub. + +**Please make sure you have completed the onboarding process which includes joining the Hack for LA Slack, GitHub, and Google Drive. If you have not been onboarded, see the [Getting Started Page](https://www.hackforla.org/getting-started).** _Workshop attendees are granted a temporary exception from this requirement._ + +- [Joining the team](team.md) + +- [Setting up the Developement Environment](dev_environment.md) + + - [Pre-requisites](dev_environment.md#pre-requisites) + - [Fork the repository](dev_environment.md#fork-the-repository) + - [Build and run locally](dev_environment.md#build-and-run) + +- [Working with Issues](issues.md) + +- [Working with Git](git.md) + +- [Documentation](documentation.md) From f554d4c40596106477ab6c42f318d959e5084256 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Tue, 23 Jul 2024 16:50:01 -0700 Subject: [PATCH 14/35] remove all header numbering These can be auto-generated if needed --- docs/contributing/dev_environment.md | 22 ++++++++++---------- docs/contributing/documentation.md | 2 +- docs/contributing/git.md | 2 +- docs/contributing/issues.md | 30 ++++++++++++++-------------- docs/contributing/team.md | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md index d358ce60..e9769b67 100644 --- a/docs/contributing/dev_environment.md +++ b/docs/contributing/dev_environment.md @@ -1,20 +1,20 @@ -## 2. Setting Up Development Environment +# Setting Up Development Environment -### 2.1 Pre-requisites +## Pre-requisites -#### 2.1.1 GitHub account +### GitHub account See [here](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account#signing-up-for-a-new-account) for creating a GitHub account. If you are not familiar with Git, [this tutorial](https://docs.github.com/en/get-started/quickstart/hello-world) is recommended. -#### 2.1.2 Two-factor authentication +### Two-factor authentication Set up two-factor authentication on your account by following this [guide](https://docs.github.com/en/github/authenticating-to-github/configuring-two-factor-authentication). -#### 2.1.3 Text editor +### Text editor [VS Code](https://code.visualstudio.com/download) is recommended, but feel free to use a text editor of your choice. -#### 2.1.4 Install Git +### Install Git Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system [**here**](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). @@ -38,7 +38,7 @@ Before cloning your forked repository to your local machine, you must have Git i - a “more up to date” option (not required but optional if you want it): This option prompts you to go to install an 8GB package manager called Homebrew. - Other option: If your computer is low on space, you can use this [tutorial](https://www.datacamp.com/community/tutorials/homebrew-install-use) to install XCode Command Tools and a lighter version of Homebrew and then install Git using this command: `$ brew install git` which in total only uses 300MB. -#### 2.1.5 Install Docker +### Install Docker Install or make sure [docker][docker-install] and [docker-compose][docker-compose-install] are installed on your computer @@ -55,7 +55,7 @@ More on using Docker and the concepts of containerization: - [Get started with Docker](https://docs.docker.com/get-started/) -### 2.2 Fork the repository +## Fork the repository You can fork the hackforla/peopledepot repository by clicking . A fork is a copy of the repository that will be placed on your GitHub account. @@ -65,7 +65,7 @@ You can fork the hackforla/peopledepot repository by clicking -15 ``` -### 4.3 Make changes +## Make changes Make changes to fix the issue. -### 4.4 Pull to get the most recent code +## Pull to get the most recent code You can probably skip this if you fix the issue on the same day that you pulled the code. @@ -56,7 +56,7 @@ git pull !!! note "If you are using Visual studios code you can use the Git graphical user interface to stage your changes. For instructions check out the [Git GUI page in the website Wiki]()" -### 4.5 Add changed files to staging +## Add changed files to staging **Make sure you are on your issue branch (instead of `main`)** @@ -78,7 +78,7 @@ Run this command if you want to **add all changes to all file(s) to your commit git add . ``` -### 4.6 Check Git status +## Check Git status This command will list the files that have been staged with green text. These are the files that will be committed (saved) when you run the next command, `git commit`. Please be sure all your staged changes are relevant to the issue you are working on. If you accidentally included unrelated changes, please unstage them before making this commit, and then make a new commit for the unrelated changes. (The commands for unstaging commits are provided in the output of your `git status` command.) @@ -86,7 +86,7 @@ This command will list the files that have been staged with green text. These ar git status ``` -### 4.7 Remove files that you don't want staged +## Remove files that you don't want staged This command will unstage a file that you don't want included in the commit. The specified file will not be committed (saved) when you run the next command, `git commit`. This only works if the wrong files were added, but they were not yet committed. (See [this tutorial](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) for an in-depth discussion.) The file will be removed from the staging area, but not actually deleted: @@ -94,7 +94,7 @@ This command will unstage a file that you don't want included in the commit. The git reset HEAD “filename.ext” ``` -### 4.8 Install pre-commit +## Install pre-commit This will check your changes for common problems. @@ -102,7 +102,7 @@ See the [Pre-commit page](tools/pre-commit.md) for installation instructions. For consistency, an automated bot will perform the same checks on the repository side when you open a pull request. -### 4.9 Commit staged changes +## Commit staged changes This command saves your work, and prepares it to push to your repository. Use the `-m` flag to quickly add a message to your commit. Your message should be a short description of the changes you made. It will be extremely helpful if other people can understand your message, so try to resist the temptation to be overly cryptic. @@ -120,7 +120,7 @@ git pull upstream You can also sync your fork directly on GitHub by clicking "Sync Fork" at the right of the screen and then clicking "Update Branch" -### 4.10 Push to upstream origin (aka, your fork) +## Push to upstream origin (aka, your fork) Push your local branch to your remote repository: @@ -134,9 +134,9 @@ Alternatively, you can run git push ``` -### 4.11 Create a pull request +## Create a pull request -#### 4.11.1 Push all changes in your issue branch +### Push all changes in your issue branch Once you are satisfied with your changes, push them to the feature branch you made within your remote repository. @@ -144,7 +144,7 @@ Once you are satisfied with your changes, push them to the feature branch you ma git push --set-upstream origin ``` -#### 4.11.2 Complete pull request from GitHub +### Complete pull request from GitHub 1. Click the green button to create a Pull Request (PR) 1. Add a short title in the subject line @@ -158,6 +158,6 @@ fixes # 1. Click the green "Create pull request" button 1. Add the PR to the project board -## 7. Creating Issues +# Creating Issues To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link. diff --git a/docs/contributing/team.md b/docs/contributing/team.md index eb764ce6..ffbf2aaf 100644 --- a/docs/contributing/team.md +++ b/docs/contributing/team.md @@ -1,4 +1,4 @@ -## 1. Joining Repository Team +# Joining Repository Team This step is optional if this is your first time fixing an issue and you want to try fixing an issue without this step. From 8bcebb21b4cd2fa2db94291f8184c9efcb104447 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 25 Jul 2024 11:12:42 -0700 Subject: [PATCH 15/35] move pre-commit section to the dev environment page --- docs/contributing/dev_environment.md | 8 ++++++++ docs/contributing/issues.md | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md index e9769b67..094ad0e3 100644 --- a/docs/contributing/dev_environment.md +++ b/docs/contributing/dev_environment.md @@ -162,5 +162,13 @@ upstream https://github.com/hackforla/peopledepot.git (push) 1. Browse to the web admin interface at `http://localhost:8000/admin/` and confirm the admin site is running. Use DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD from .env.docker for credentials. +## Install pre-commit + +This will check your changes for common problems. + +See the [Pre-commit page](tools/pre-commit.md) for installation instructions. + +For consistency, an automated bot will perform the same checks on the repository side when you open a pull request. + [docker-compose-install]: https://docs.docker.com/compose/install/ [docker-install]: https://docs.docker.com/get-docker/ diff --git a/docs/contributing/issues.md b/docs/contributing/issues.md index 95e9a992..128f3ff7 100644 --- a/docs/contributing/issues.md +++ b/docs/contributing/issues.md @@ -94,14 +94,6 @@ This command will unstage a file that you don't want included in the commit. The git reset HEAD “filename.ext” ``` -## Install pre-commit - -This will check your changes for common problems. - -See the [Pre-commit page](tools/pre-commit.md) for installation instructions. - -For consistency, an automated bot will perform the same checks on the repository side when you open a pull request. - ## Commit staged changes This command saves your work, and prepares it to push to your repository. Use the `-m` flag to quickly add a message to your commit. Your message should be a short description of the changes you made. It will be extremely helpful if other people can understand your message, so try to resist the temptation to be overly cryptic. From d0074c1e2b5b25a34497435b453eafd646ff71e6 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Fri, 26 Jul 2024 16:10:16 -0700 Subject: [PATCH 16/35] update titles for contributing pages --- docs/contributing/dev_environment.md | 2 +- docs/contributing/git.md | 4 +++- docs/contributing/issues.md | 2 +- docs/tools/docker.md | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md index 094ad0e3..8285f4d8 100644 --- a/docs/contributing/dev_environment.md +++ b/docs/contributing/dev_environment.md @@ -1,4 +1,4 @@ -# Setting Up Development Environment +# Development Environment ## Pre-requisites diff --git a/docs/contributing/git.md b/docs/contributing/git.md index eb7e643c..cba67115 100644 --- a/docs/contributing/git.md +++ b/docs/contributing/git.md @@ -1,4 +1,6 @@ -# Sync Main Changes +# Working with Git + +## Sync Main Changes Your fork of this repository on GitHub, and your local clone of that fork, will get out of sync with the (upstream) repository as others update the repository. (That's what has happened when you see something like "This branch is 1 commit behind peopledepot:main" on your forked repository.) diff --git a/docs/contributing/issues.md b/docs/contributing/issues.md index 128f3ff7..788b750f 100644 --- a/docs/contributing/issues.md +++ b/docs/contributing/issues.md @@ -1,4 +1,4 @@ -# Fixing Issues +# Working with Issues ## Find an issue diff --git a/docs/tools/docker.md b/docs/tools/docker.md index a4a396fa..fe8b3a00 100644 --- a/docs/tools/docker.md +++ b/docs/tools/docker.md @@ -1,6 +1,6 @@ # Docker -## Managing Docker +## Working with Docker ### Stopping Docker From 0a0b21902aa2f1bc2dafac4cc30424b645356e92 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Fri, 26 Jul 2024 11:44:52 -0700 Subject: [PATCH 17/35] update links to contributing pages --- docs/contributing/dev_environment.md | 2 ++ docs/how-to/add-model-and-api-endpoints.md | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md index 8285f4d8..5e4b732d 100644 --- a/docs/contributing/dev_environment.md +++ b/docs/contributing/dev_environment.md @@ -162,6 +162,8 @@ upstream https://github.com/hackforla/peopledepot.git (push) 1. Browse to the web admin interface at `http://localhost:8000/admin/` and confirm the admin site is running. Use DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD from .env.docker for credentials. +See our documentation for [Working with Docker](http://localhost:8005/contributing/tools/docker/#working-with-docker) for more useful Docker commands. + ## Install pre-commit This will check your changes for common problems. diff --git a/docs/how-to/add-model-and-api-endpoints.md b/docs/how-to/add-model-and-api-endpoints.md index ef67ac5c..70aba64c 100644 --- a/docs/how-to/add-model-and-api-endpoints.md +++ b/docs/how-to/add-model-and-api-endpoints.md @@ -13,7 +13,7 @@ This guide aims to enable developers with little or no django experience to add - API design - command line -This guide assumes the developer has followed the [contributing doc](CONTRIBUTING.md) and have forked and created a local branch to work on this. The development server would be already running in the background and will automatically apply the changes when we save the files. +This guide assumes the developer has followed the [working with issues guide](issues.md) and have forked and created a local branch to work on this. The development server would be already running in the background and will automatically apply the changes when we save the files. We will choose the [recurring_event issue](https://github.com/hackforla/peopledepot/issues/14) as an example. Our goal is to create a database table and an API that a client can use to work with the data. The work is split into 3 testable components: the model, the admin site, and the API @@ -205,7 +205,7 @@ In `app/core/admin.py` Check that everything's working and there are no issues, which should be the case unless there's custom input fields creating problems. -1. See the [contributing doc section on "Build and run using Docker locally"](CONTRIBUTING.md#23-build-and-run-using-docker-locally) for how to view the admin interface. +1. See the [development setup guide section on "Build and run using Docker locally"](dev_environment.md#build-and-run-using-docker-locally) for how to view the admin interface. 1. Example of a custom field (as opposed to the built-in ones) @@ -508,4 +508,4 @@ In `app/core/api/urls.py` ``` ??? note "Push the code and start a PR" - Refer to the [contributing doc section on "Push to upstream origin"](CONTRIBUTING.md#410-push-to-upstream-origin-aka-your-fork) onward. + Refer to the [Issues page section on "Push to upstream origin"](issues.md#push-to-upstream-origin-aka-your-fork) onward. From 85a2dddb6986baaaa74943fe546465d0fcea2dd8 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Fri, 26 Jul 2024 16:09:30 -0700 Subject: [PATCH 18/35] update team.md with slack channel link --- docs/contributing/team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/team.md b/docs/contributing/team.md index ffbf2aaf..8d8c087a 100644 --- a/docs/contributing/team.md +++ b/docs/contributing/team.md @@ -2,7 +2,7 @@ This step is optional if this is your first time fixing an issue and you want to try fixing an issue without this step. -In the `people-depot` Slack channel, send an introductory message with your GitHub handle/username asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma. +In the [People-depot Slack channel](https://hackforla.slack.com/messages/people-depot/), send an introductory message with your GitHub `handle/username` asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma. !!! note "Please do the following once you have accepted the GitHub invite (comes via email or in your GitHub notifications)" Make your own Hack for LA GitHub organization membership public by following this [guide](https://help.github.com/en/articles/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership). From ffae7aea3edcc3fd0c626b446298538ff39e3fb8 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Tue, 23 Jul 2024 16:43:11 -0700 Subject: [PATCH 19/35] move how-to and tools to contributing --- docs/.pages | 2 -- docs/contributing/.pages | 2 ++ docs/contributing/howto/.pages | 6 ++++++ .../howto}/add-model-and-api-endpoints.md | 0 .../howto}/create-initial-data-migrations.md | 0 docs/contributing/howto/index.md | 7 +++++++ docs/{how-to => contributing/howto}/run-local.md | 0 docs/contributing/index.md | 4 ++++ docs/{ => contributing}/tools/.pages | 0 docs/{ => contributing}/tools/docker.md | 0 docs/contributing/tools/index.md | 9 +++++++++ docs/{ => contributing}/tools/mkdocs.md | 0 docs/{ => contributing}/tools/pre-commit.md | 0 docs/{ => contributing}/tools/scripts.md | 0 docs/{ => contributing}/tools/uv.md | 0 docs/how-to/.pages | 1 - docs/tools/index.md | 12 ------------ 17 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 docs/contributing/howto/.pages rename docs/{how-to => contributing/howto}/add-model-and-api-endpoints.md (100%) rename docs/{how-to => contributing/howto}/create-initial-data-migrations.md (100%) create mode 100644 docs/contributing/howto/index.md rename docs/{how-to => contributing/howto}/run-local.md (100%) rename docs/{ => contributing}/tools/.pages (100%) rename docs/{ => contributing}/tools/docker.md (100%) create mode 100644 docs/contributing/tools/index.md rename docs/{ => contributing}/tools/mkdocs.md (100%) rename docs/{ => contributing}/tools/pre-commit.md (100%) rename docs/{ => contributing}/tools/scripts.md (100%) rename docs/{ => contributing}/tools/uv.md (100%) delete mode 100644 docs/how-to/.pages delete mode 100644 docs/tools/index.md diff --git a/docs/.pages b/docs/.pages index eee111df..4441258b 100644 --- a/docs/.pages +++ b/docs/.pages @@ -3,7 +3,5 @@ nav: - architecture - ref - howto - - how-to - - tools - contributing - license.md diff --git a/docs/contributing/.pages b/docs/contributing/.pages index b7f0c70c..b2d1873f 100644 --- a/docs/contributing/.pages +++ b/docs/contributing/.pages @@ -4,4 +4,6 @@ nav: - issues.md - git.md - documentation.md + - howto - ... + - tools diff --git a/docs/contributing/howto/.pages b/docs/contributing/howto/.pages new file mode 100644 index 00000000..d6f5c6ed --- /dev/null +++ b/docs/contributing/howto/.pages @@ -0,0 +1,6 @@ +title: How-to Guides +nav: + - add-model-and-api-endpoints.md + - create-initial-data-migrations.md + - run-local.md + - ... diff --git a/docs/how-to/add-model-and-api-endpoints.md b/docs/contributing/howto/add-model-and-api-endpoints.md similarity index 100% rename from docs/how-to/add-model-and-api-endpoints.md rename to docs/contributing/howto/add-model-and-api-endpoints.md diff --git a/docs/how-to/create-initial-data-migrations.md b/docs/contributing/howto/create-initial-data-migrations.md similarity index 100% rename from docs/how-to/create-initial-data-migrations.md rename to docs/contributing/howto/create-initial-data-migrations.md diff --git a/docs/contributing/howto/index.md b/docs/contributing/howto/index.md new file mode 100644 index 00000000..5634bd1a --- /dev/null +++ b/docs/contributing/howto/index.md @@ -0,0 +1,7 @@ +# How-to Guides + +These are the developer guides for how to do specific things with the project. + +1. [Add model and API endpoints](add-model-and-api-endpoints.md) +1. [Create initial data migrations](create-initial-data-migrations.md) +1. [Run the project in a virtual environment](run-local.md) diff --git a/docs/how-to/run-local.md b/docs/contributing/howto/run-local.md similarity index 100% rename from docs/how-to/run-local.md rename to docs/contributing/howto/run-local.md diff --git a/docs/contributing/index.md b/docs/contributing/index.md index ac7f69e9..c3101a60 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -17,3 +17,7 @@ Thank you for volunteering your time! The following is a set of guidelines for c - [Working with Git](git.md) - [Documentation](documentation.md) + +- [How-to Guides](how-to/index.md) + +- [Tools](tools/index.md) diff --git a/docs/tools/.pages b/docs/contributing/tools/.pages similarity index 100% rename from docs/tools/.pages rename to docs/contributing/tools/.pages diff --git a/docs/tools/docker.md b/docs/contributing/tools/docker.md similarity index 100% rename from docs/tools/docker.md rename to docs/contributing/tools/docker.md diff --git a/docs/contributing/tools/index.md b/docs/contributing/tools/index.md new file mode 100644 index 00000000..be7f9d1a --- /dev/null +++ b/docs/contributing/tools/index.md @@ -0,0 +1,9 @@ +# Tools + +These are the tools we use in the PeopleDepot project with notes on how we use them. + +- [Convenience scripts](scripts.md) +- [Docker](docker.md) for containerization +- [MkDocs](mkdocs.md) for documentation +- [Pre-commit](pre-commit.md) for linting +- [Uv](uv.md) for fast dependency resolution diff --git a/docs/tools/mkdocs.md b/docs/contributing/tools/mkdocs.md similarity index 100% rename from docs/tools/mkdocs.md rename to docs/contributing/tools/mkdocs.md diff --git a/docs/tools/pre-commit.md b/docs/contributing/tools/pre-commit.md similarity index 100% rename from docs/tools/pre-commit.md rename to docs/contributing/tools/pre-commit.md diff --git a/docs/tools/scripts.md b/docs/contributing/tools/scripts.md similarity index 100% rename from docs/tools/scripts.md rename to docs/contributing/tools/scripts.md diff --git a/docs/tools/uv.md b/docs/contributing/tools/uv.md similarity index 100% rename from docs/tools/uv.md rename to docs/contributing/tools/uv.md diff --git a/docs/how-to/.pages b/docs/how-to/.pages deleted file mode 100644 index 74adc943..00000000 --- a/docs/how-to/.pages +++ /dev/null @@ -1 +0,0 @@ -title: Developer Guides diff --git a/docs/tools/index.md b/docs/tools/index.md deleted file mode 100644 index a8f21cef..00000000 --- a/docs/tools/index.md +++ /dev/null @@ -1,12 +0,0 @@ -## A. Submitting Bugs for Third Party Packages / Apps - -You can go to these links and submit an issue: - -- [Docker](https://github.com/docker) -- [Flake8][flake8-docs] -- [Black][black-docs] -- [isort][isort-docs] - -[black-docs]: https://github.com/psf/black -[flake8-docs]: https://github.com/pycqa/flake8 -[isort-docs]: https://github.com/pycqa/isort/ From 2c823a0d87203cc4b3d4613c28dc11cd7393bf6a Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Sat, 24 Aug 2024 01:50:33 -0700 Subject: [PATCH 20/35] fix local dev api url in add model guide --- docs/contributing/howto/add-model-and-api-endpoints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing/howto/add-model-and-api-endpoints.md b/docs/contributing/howto/add-model-and-api-endpoints.md index 70aba64c..6ddb7d17 100644 --- a/docs/contributing/howto/add-model-and-api-endpoints.md +++ b/docs/contributing/howto/add-model-and-api-endpoints.md @@ -441,10 +441,10 @@ In `app/core/api/urls.py` 1. Params 1. First param is the URL prefix use in the API routes. It is, by convention, plural - - This would show up in the URL like this: `http://localhost/api/v1/recuring-events/` and `http://localhost/api/v1/recuring-events/` + - This would show up in the URL like this: `http://localhost:8000/api/v1/recuring-events/` and `http://localhost:8000/api/v1/recuring-events/` 1. Second param is the viewset class which defines the API actions 1. `basename` is the name used for generating the endpoint names, such as -list, -detail, etc. It's in the singular form. This is automatically generated if the viewset definition contains a `queryset` attribute, but it's required if the viewset overrides that with the `get_queryset` function - - `reverse("recurring-event-list")` would return `http://localhost/api/v1/recuring-events/` + - `reverse("recurring-event-list")` would return `http://localhost:8000/api/v1/recuring-events/` ??? note "Test" For the CRUD operations, since we're using `ModelViewSet` where all the actions are provided by `rest_framework` and well-tested, it's not necessary to have test cases for them. But here's an example of one. From df1619117a394ddcfb57bd92a67803171c795ec4 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Tue, 3 Sep 2024 12:23:55 -0700 Subject: [PATCH 21/35] fix link in contributing index.md --- docs/contributing/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/index.md b/docs/contributing/index.md index c3101a60..2c3d40ae 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -10,7 +10,7 @@ Thank you for volunteering your time! The following is a set of guidelines for c - [Pre-requisites](dev_environment.md#pre-requisites) - [Fork the repository](dev_environment.md#fork-the-repository) - - [Build and run locally](dev_environment.md#build-and-run) + - [Build and run locally](dev_environment.md#build-and-run-using-docker-locally) - [Working with Issues](issues.md) From 6bc00b1612b4133c22b8e3aa7fb211edeee324f7 Mon Sep 17 00:00:00 2001 From: "Sarah Monks, PhD" <141967111+shmonks@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:29:12 -0700 Subject: [PATCH 22/35] Updated link to Prioritized Backlog and a few typos corrected --- docs/contributing/issues.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing/issues.md b/docs/contributing/issues.md index 788b750f..71b167e3 100644 --- a/docs/contributing/issues.md +++ b/docs/contributing/issues.md @@ -2,9 +2,9 @@ ## Find an issue -Find an issue in Prioritized Backlog [here](https://github.com/hackforla/peopledepot/projects/1#column-16900748) +Find an issue in Prioritized Backlog [here](https://github.com/orgs/hackforla/projects/61/views/2) -If you joined the peopledepot repository as described in a previous section: +If you joined the PeopleDepot repository as described in a previous section: 1. Assign the issue to yourself and move it to "In progress" column. 1. Follow the steps in the issue description to complete the issue. From 03dcd8f5fcf9be5365b1fa628c55a68a0ad0580c Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 17 Oct 2024 00:16:20 -0700 Subject: [PATCH 23/35] list tools in alphabetical order --- docs/contributing/tools/.pages | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/contributing/tools/.pages b/docs/contributing/tools/.pages index 454d9d70..f2ee6a4a 100644 --- a/docs/contributing/tools/.pages +++ b/docs/contributing/tools/.pages @@ -1,4 +1,3 @@ nav: - scripts.md - - mkdocs.md - ... From c884cdeac724c2a85eee636fb60264741cf9e122 Mon Sep 17 00:00:00 2001 From: "Sarah Monks, PhD" <141967111+shmonks@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:41:58 -0700 Subject: [PATCH 24/35] Corrected typo --- docs/contributing/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 2c3d40ae..1640c5ed 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -6,7 +6,7 @@ Thank you for volunteering your time! The following is a set of guidelines for c - [Joining the team](team.md) -- [Setting up the Developement Environment](dev_environment.md) +- [Setting up the Development Environment](dev_environment.md) - [Pre-requisites](dev_environment.md#pre-requisites) - [Fork the repository](dev_environment.md#fork-the-repository) From dfcf5bdffa4a1e0be1dfee2a001aaa999d80b0c9 Mon Sep 17 00:00:00 2001 From: "Sarah Monks, PhD" <141967111+shmonks@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:43:04 -0700 Subject: [PATCH 25/35] Corrected typo --- docs/contributing/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 1640c5ed..72e046b1 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -1,6 +1,6 @@ # Contributing -Thank you for volunteering your time! The following is a set of guidelines for contributing to the peopledepot repository, which is hosted on GitHub. +Thank you for volunteering your time! The following is a set of guidelines for contributing to the PeopleDepot repository, which is hosted on GitHub. **Please make sure you have completed the onboarding process which includes joining the Hack for LA Slack, GitHub, and Google Drive. If you have not been onboarded, see the [Getting Started Page](https://www.hackforla.org/getting-started).** _Workshop attendees are granted a temporary exception from this requirement._ From e3021d80a86145ccb602e7d2b2c173dd02b1a9a6 Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 17 Oct 2024 00:15:50 -0700 Subject: [PATCH 26/35] fix link to How-to Guides in Contributing index --- docs/contributing/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 72e046b1..4b887f43 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -18,6 +18,6 @@ Thank you for volunteering your time! The following is a set of guidelines for c - [Documentation](documentation.md) -- [How-to Guides](how-to/index.md) +- [How-to Guides](howto/index.md) - [Tools](tools/index.md) From 590cd97657a9203c50b71272816fb5f53172d43a Mon Sep 17 00:00:00 2001 From: Fang Yi Liu Date: Thu, 17 Oct 2024 00:26:39 -0700 Subject: [PATCH 27/35] fix link to Working with Docker --- docs/contributing/dev_environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/dev_environment.md b/docs/contributing/dev_environment.md index 5e4b732d..4e12ac25 100644 --- a/docs/contributing/dev_environment.md +++ b/docs/contributing/dev_environment.md @@ -162,7 +162,7 @@ upstream https://github.com/hackforla/peopledepot.git (push) 1. Browse to the web admin interface at `http://localhost:8000/admin/` and confirm the admin site is running. Use DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD from .env.docker for credentials. -See our documentation for [Working with Docker](http://localhost:8005/contributing/tools/docker/#working-with-docker) for more useful Docker commands. +See our documentation for [Working with Docker](tools/docker.md#working-with-docker) for more useful Docker commands. ## Install pre-commit From 3c39e336651906dc180f6a1cb7d860ab38991b3c Mon Sep 17 00:00:00 2001 From: "Sarah Monks, PhD" <141967111+shmonks@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:15:04 -0700 Subject: [PATCH 28/35] Revise issue templates (#407) * Adding complexity label * Adding missing labels * Adding labels to new issue templates * Add missing labels to new issue template * Add missing labels to new issue templates * Add missing labels to new issue template * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Apply suggestions from code review I added and removed some labels --------- Co-authored-by: Bonnie Wolfe <37763229+ExperimentsInHonesty@users.noreply.github.com> --- .../add-project-logo-or-image-to-your-main-repository.md | 3 +-- .github/ISSUE_TEMPLATE/add-seed-data-to-a-table.md | 3 +-- .github/ISSUE_TEMPLATE/blank-issue.md | 3 +-- ...-when-you-paste-your-sites-link-in-social-media-sites.md | 6 +++--- .github/ISSUE_TEMPLATE/create-agenda.md | 3 ++- .../create-project-card-for--project-name-.md | 3 ++- .github/ISSUE_TEMPLATE/create-table-issue-template.md | 2 +- .github/ISSUE_TEMPLATE/emergent-request.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/ISSUE_TEMPLATE/post-open-role.md | 3 ++- .github/ISSUE_TEMPLATE/update-content-for-readme-file.md | 3 ++- .github/ISSUE_TEMPLATE/update-team-roster.md | 3 ++- 12 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md b/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md index d6707126..5725049d 100644 --- a/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md +++ b/.github/ISSUE_TEMPLATE/add-project-logo-or-image-to-your-main-repository.md @@ -2,8 +2,7 @@ name: Add project logo or image to your main repository about: Simple action that will make it possible to add project to hackforla.org website title: '' -labels: 'complexity: medium, enhancement, feature: branding, milestone: missing, role: - product, s: PD team, size: 1pt' +labels: 'complexity: medium, enhancement, feature: branding, milestone: missing, role: product, s: PD team, size: 1pt' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/add-seed-data-to-a-table.md b/.github/ISSUE_TEMPLATE/add-seed-data-to-a-table.md index ca4a4bfb..b75eef6d 100644 --- a/.github/ISSUE_TEMPLATE/add-seed-data-to-a-table.md +++ b/.github/ISSUE_TEMPLATE/add-seed-data-to-a-table.md @@ -3,8 +3,7 @@ name: Add seed data to a table about: For adding data that will be the same no matter what organization uses People Depot title: 'Add seed data for Table: [Replace with TABLE NAME]' -labels: 'good first issue, role: back end, s: CTJ, s: hackforla.org, s: kb, s: org, - s: PD team, s: tables, s: VRMS, size: 1pt' +labels: 'good first issue, role: back end, s: missing, size: 1pt, complexity: small, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/blank-issue.md b/.github/ISSUE_TEMPLATE/blank-issue.md index c9a6dfc9..234897c8 100644 --- a/.github/ISSUE_TEMPLATE/blank-issue.md +++ b/.github/ISSUE_TEMPLATE/blank-issue.md @@ -2,8 +2,7 @@ name: Blank Issue about: Consistent formatting makes Issues concise and easy to navigate. title: '' -labels: 'complexity: missing, feature: missing, milestone: missing, points: missing, - role: missing, size: missing, stakeholder: missing' +labels: 'role: missing, size: missing, feature: missing, stakeholder: missing, complexity: missing, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/control-what-appears-when-you-paste-your-sites-link-in-social-media-sites.md b/.github/ISSUE_TEMPLATE/control-what-appears-when-you-paste-your-sites-link-in-social-media-sites.md index 9c568faa..b28a26a8 100644 --- a/.github/ISSUE_TEMPLATE/control-what-appears-when-you-paste-your-sites-link-in-social-media-sites.md +++ b/.github/ISSUE_TEMPLATE/control-what-appears-when-you-paste-your-sites-link-in-social-media-sites.md @@ -1,8 +1,8 @@ --- -name: Control what appears when you paste your sites link in social media sites +name: Control what appears when you paste your site's link in social media sites about: Add Open Graph Markup tags to header -title: Control what appears when you paste your sites link in social media sites -labels: enhancement, question +title: Control what appears when you paste your site's link in social media sites +labels: 'role: product, size: 0.25, feature: branding, s: PD team, complexity: small, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/create-agenda.md b/.github/ISSUE_TEMPLATE/create-agenda.md index 132f47a2..1dc7dda4 100644 --- a/.github/ISSUE_TEMPLATE/create-agenda.md +++ b/.github/ISSUE_TEMPLATE/create-agenda.md @@ -2,8 +2,9 @@ name: Create Agenda about: Assign issue to all team members day after meetup in prep for next meetup title: '' -labels: documentation, help wanted, question +labels: 'role: product, feature: agenda, s: PD team, complexity: small, size: 0.25pt' assignees: '' +milestone: '05. Team Workflow' --- diff --git a/.github/ISSUE_TEMPLATE/create-project-card-for--project-name-.md b/.github/ISSUE_TEMPLATE/create-project-card-for--project-name-.md index 702fdcaa..cafa3c9d 100644 --- a/.github/ISSUE_TEMPLATE/create-project-card-for--project-name-.md +++ b/.github/ISSUE_TEMPLATE/create-project-card-for--project-name-.md @@ -2,8 +2,9 @@ name: Create project card for [project name] about: Gather information to add this project to HackforLA's website title: '' -labels: documentation, good first issue, question +labels: 'complexity: small, role: product, size: 1pt, feature: branding, s: PD team, s: hackforla.org, complexity: small' assignees: '' +milestone: '03. Org Requirements' --- diff --git a/.github/ISSUE_TEMPLATE/create-table-issue-template.md b/.github/ISSUE_TEMPLATE/create-table-issue-template.md index 81cea28c..961063f8 100644 --- a/.github/ISSUE_TEMPLATE/create-table-issue-template.md +++ b/.github/ISSUE_TEMPLATE/create-table-issue-template.md @@ -2,7 +2,7 @@ name: Create Table issue template about: Create an issue for each table required title: 'Create Table: [name of table]' -labels: 'role: back end, size: 2pt' +labels: 'role: back end, size: 2pt, feature: table creation, s: hackforla.org, s: VRMS, s: CTJ, s: tables, s: kb, complexity: missing, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/emergent-request.md b/.github/ISSUE_TEMPLATE/emergent-request.md index c0402d9d..b95993ad 100644 --- a/.github/ISSUE_TEMPLATE/emergent-request.md +++ b/.github/ISSUE_TEMPLATE/emergent-request.md @@ -3,7 +3,7 @@ name: Emergent Request about: When you discover something in your issue that is out of scope and it needs a new issue or discussion title: 'ER: [replace with info ]' -labels: 'size: 0.25pt' +labels: 'role: missing, size: 0.25pt, feature: missing, stakeholder: missing, complexity: missing, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f2819b22..00f9b202 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: 'Feature Suggestion: ' -labels: documentation +labels: 'enhancement, documentation, role: missing, size: missing, feature: missing, stakeholder: missing, complexity: missing, milestone: missing' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/post-open-role.md b/.github/ISSUE_TEMPLATE/post-open-role.md index b3702df3..76e71da0 100644 --- a/.github/ISSUE_TEMPLATE/post-open-role.md +++ b/.github/ISSUE_TEMPLATE/post-open-role.md @@ -2,8 +2,9 @@ name: Post an open role about: Recruit volunteers for specific open roles template title: 'PD: Open Role for: [Replace with NAME OF ROLE]' -labels: 'complexity: small, feature: recruiting, role: missing, size: 0.25pt' +labels: 'complexity: small, feature: recruiting, role: missing, size: 0.25pt, s: PD team' assignees: '' +milestone: '05. Team Workflow' --- diff --git a/.github/ISSUE_TEMPLATE/update-content-for-readme-file.md b/.github/ISSUE_TEMPLATE/update-content-for-readme-file.md index a4168b28..5dd00440 100644 --- a/.github/ISSUE_TEMPLATE/update-content-for-readme-file.md +++ b/.github/ISSUE_TEMPLATE/update-content-for-readme-file.md @@ -2,8 +2,9 @@ name: Update Content for ReadMe file about: Instructions for revising the README.md file inside this repository title: '' -labels: documentation, good first issue, help wanted, question +labels: 'documentation, good first issue, help wanted, question, role: missing, size: missing, feature: docs: PD team documentation, s: PD team, complexity: missing' assignees: '' +milestone: '04. Project Setup' --- diff --git a/.github/ISSUE_TEMPLATE/update-team-roster.md b/.github/ISSUE_TEMPLATE/update-team-roster.md index fb3a48e3..bf2410de 100644 --- a/.github/ISSUE_TEMPLATE/update-team-roster.md +++ b/.github/ISSUE_TEMPLATE/update-team-roster.md @@ -2,8 +2,9 @@ name: Update Team Roster about: Provides new team members a link to team roster to input their information title: '' -labels: documentation, good first issue, question +labels: 'documentation, good first issue, question, role: missing, size: 0.25pt, feature: PD team recruit/onboard/offboard, s: PD team, complexity: small' assignees: '' +milestone: '05. Team Workflow' --- From 7f7b8033588b8c207e2158f2f69d9eaf567fb2a3 Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 4 Oct 2024 18:16:47 -0400 Subject: [PATCH 29/35] feat: add and test many-to-many relationship between program_area and project --- .../migrations/0028_project_program_areas.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/core/migrations/0028_project_program_areas.py diff --git a/app/core/migrations/0028_project_program_areas.py b/app/core/migrations/0028_project_program_areas.py new file mode 100644 index 00000000..c8dea90f --- /dev/null +++ b/app/core/migrations/0028_project_program_areas.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.11 on 2024-10-04 18:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0027_socmajor"), + ] + + operations = [ + migrations.AddField( + model_name="project", + name="program_areas", + field=models.ManyToManyField( + blank=True, related_name="projects", to="core.programarea" + ), + ), + ] From c41ab2c616e860f85a3877f533eb05a46506d7a1 Mon Sep 17 00:00:00 2001 From: del9ra Date: Thu, 31 Oct 2024 21:30:30 -0400 Subject: [PATCH 30/35] feat: add model: ProjectProgramAreaXref --- .../migrations/0028_project_program_areas.py | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 app/core/migrations/0028_project_program_areas.py diff --git a/app/core/migrations/0028_project_program_areas.py b/app/core/migrations/0028_project_program_areas.py deleted file mode 100644 index c8dea90f..00000000 --- a/app/core/migrations/0028_project_program_areas.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.2.11 on 2024-10-04 18:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0027_socmajor"), - ] - - operations = [ - migrations.AddField( - model_name="project", - name="program_areas", - field=models.ManyToManyField( - blank=True, related_name="projects", to="core.programarea" - ), - ), - ] From 6258799bf75bac64db9017de42ec3863e391b4aa Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 1 Nov 2024 11:28:58 -0400 Subject: [PATCH 31/35] fixed a merge conflict --- ...y => 0029_projectprogramareaxref_project_program_areas.py} | 4 ++-- app/core/migrations/max_migration.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename app/core/migrations/{0028_projectprogramareaxref_project_program_areas.py => 0029_projectprogramareaxref_project_program_areas.py} (94%) diff --git a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py b/app/core/migrations/0029_projectprogramareaxref_project_program_areas.py similarity index 94% rename from app/core/migrations/0028_projectprogramareaxref_project_program_areas.py rename to app/core/migrations/0029_projectprogramareaxref_project_program_areas.py index 310737c0..44bd5c2a 100644 --- a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py +++ b/app/core/migrations/0029_projectprogramareaxref_project_program_areas.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.11 on 2024-10-31 22:55 +# Generated by Django 4.2.11 on 2024-11-01 14:57 from django.db import migrations, models import django.db.models.deletion @@ -8,7 +8,7 @@ class Migration(migrations.Migration): dependencies = [ - ("core", "0027_socmajor"), + ("core", "0028_alter_userpermission_project"), ] operations = [ diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index aa318cff..91821a07 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0028_alter_userpermission_project +0029_projectprogramareaxref_project_program_areas From 9d5728f73acbb211f763d2f08a4ca543e903c923 Mon Sep 17 00:00:00 2001 From: del9ra Date: Thu, 31 Oct 2024 21:30:30 -0400 Subject: [PATCH 32/35] feat: add model: ProjectProgramAreaXref --- ...ctprogramareaxref_project_program_areas.py | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 app/core/migrations/0028_projectprogramareaxref_project_program_areas.py diff --git a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py b/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py new file mode 100644 index 00000000..310737c0 --- /dev/null +++ b/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py @@ -0,0 +1,64 @@ +# Generated by Django 4.2.11 on 2024-10-31 22:55 + +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0027_socmajor"), + ] + + operations = [ + migrations.CreateModel( + name="ProjectProgramAreaXref", + fields=[ + ( + "uuid", + models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ( + "created_at", + models.DateTimeField(auto_now_add=True, verbose_name="Created at"), + ), + ( + "updated_at", + models.DateTimeField(auto_now=True, verbose_name="Updated at"), + ), + ( + "program_area_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="core.programarea", + ), + ), + ( + "project_id", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="core.project" + ), + ), + ], + options={ + "abstract": False, + }, + ), + migrations.AddField( + model_name="project", + name="program_areas", + field=models.ManyToManyField( + blank=True, + related_name="projects", + through="core.ProjectProgramAreaXref", + to="core.programarea", + ), + ), + ] From bd85788c9f5db63e68a19cf0349970d27122b8b0 Mon Sep 17 00:00:00 2001 From: Ethan Strominger Date: Mon, 7 Oct 2024 20:15:43 -0400 Subject: [PATCH 33/35] Migration scripts --- .../migrations/0029_project_program_areas.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/core/migrations/0029_project_program_areas.py diff --git a/app/core/migrations/0029_project_program_areas.py b/app/core/migrations/0029_project_program_areas.py new file mode 100644 index 00000000..479b0103 --- /dev/null +++ b/app/core/migrations/0029_project_program_areas.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-10-04 18:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("core", "0028_alter_userpermission_project")] + + operations = [ + migrations.AddField( + model_name="project", + name="program_areas", + field=models.ManyToManyField( + blank=True, related_name="projects", to="core.programarea" + ), + ), + ] From 27d9c07271d9640fbabfb25e2b63b16d49461e9b Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 1 Nov 2024 11:28:58 -0400 Subject: [PATCH 34/35] fixed a merge conflict --- ...ctprogramareaxref_project_program_areas.py | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 app/core/migrations/0028_projectprogramareaxref_project_program_areas.py diff --git a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py b/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py deleted file mode 100644 index 310737c0..00000000 --- a/app/core/migrations/0028_projectprogramareaxref_project_program_areas.py +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by Django 4.2.11 on 2024-10-31 22:55 - -from django.db import migrations, models -import django.db.models.deletion -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0027_socmajor"), - ] - - operations = [ - migrations.CreateModel( - name="ProjectProgramAreaXref", - fields=[ - ( - "uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - ( - "created_at", - models.DateTimeField(auto_now_add=True, verbose_name="Created at"), - ), - ( - "updated_at", - models.DateTimeField(auto_now=True, verbose_name="Updated at"), - ), - ( - "program_area_id", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="core.programarea", - ), - ), - ( - "project_id", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="core.project" - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AddField( - model_name="project", - name="program_areas", - field=models.ManyToManyField( - blank=True, - related_name="projects", - through="core.ProjectProgramAreaXref", - to="core.programarea", - ), - ), - ] From eca9bd683df658336334729eb47db11c5397639d Mon Sep 17 00:00:00 2001 From: del9ra Date: Fri, 1 Nov 2024 15:11:34 -0400 Subject: [PATCH 35/35] feat: fixed a merge conflict --- .../migrations/0029_project_program_areas.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 app/core/migrations/0029_project_program_areas.py diff --git a/app/core/migrations/0029_project_program_areas.py b/app/core/migrations/0029_project_program_areas.py deleted file mode 100644 index 479b0103..00000000 --- a/app/core/migrations/0029_project_program_areas.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.11 on 2024-10-04 18:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [("core", "0028_alter_userpermission_project")] - - operations = [ - migrations.AddField( - model_name="project", - name="program_areas", - field=models.ManyToManyField( - blank=True, related_name="projects", to="core.programarea" - ), - ), - ]