From b7f10e2b926b5e10fc3cb66a373c747efc1f3ba1 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:04:37 -0600 Subject: [PATCH 1/9] Updated README.md to include a fix for line endings Updated the readme to include a fix for windows machines... On windows, you cannot run manage.py (or other related files) as they are using the wrong file endings. It basically doesn't know where to look. The fix to this is to add .gitattribute locally and rebuild your project, so that it reverts to standard line-endings on your machine (but not elsewhere) --- docs/developer/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/developer/README.md b/docs/developer/README.md index d824ea820..1fe36c4b2 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -18,6 +18,9 @@ If you're new to Django, see [Getting Started with Django](https://www.djangopro Visit the running application at [http://localhost:8080](http://localhost:8080). +Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). +If you'd rather not change this globally, add a .gitattributes file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) + ## Branch Conventions We use the branch convention of `initials/branch-topic` (ex: `lmm/fix-footer`). This allows for automated deployment to a developer sandbox namespaced to the initials. From e8422eac7d4147ce297a97898d0660fabda2822e Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Thu, 3 Aug 2023 07:47:38 -0600 Subject: [PATCH 2/9] Updated README.md to be more descriptive Added an explanation for why Windows developers may need to change their line endings --- docs/developer/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/developer/README.md b/docs/developer/README.md index 1fe36c4b2..ea87c99db 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -19,7 +19,8 @@ If you're new to Django, see [Getting Started with Django](https://www.djangopro Visit the running application at [http://localhost:8080](http://localhost:8080). Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). -If you'd rather not change this globally, add a .gitattributes file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) +* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access Python. Since our scripts are still thinking in terms of unix line seperators, they may look for the *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` +* If you'd rather not change this globally, add a `.gitattributes` file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) ## Branch Conventions From 864e31eba3f506938f4d127db8fb94537d8b8132 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Thu, 3 Aug 2023 07:49:12 -0600 Subject: [PATCH 3/9] Fixed a typo in README.md --- docs/developer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/README.md b/docs/developer/README.md index ea87c99db..ca35b5891 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -19,7 +19,7 @@ If you're new to Django, see [Getting Started with Django](https://www.djangopro Visit the running application at [http://localhost:8080](http://localhost:8080). Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). -* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access Python. Since our scripts are still thinking in terms of unix line seperators, they may look for the *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` +* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access Python. Since our scripts are still thinking in terms of unix line seperators, they may look for *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` * If you'd rather not change this globally, add a `.gitattributes` file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) ## Branch Conventions From 6d721ad6fbc2af3f442a84b1b665462c81d63f3d Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Thu, 3 Aug 2023 07:55:37 -0600 Subject: [PATCH 4/9] Another minor verbiage change --- docs/developer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/README.md b/docs/developer/README.md index ca35b5891..886b435d9 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -19,7 +19,7 @@ If you're new to Django, see [Getting Started with Django](https://www.djangopro Visit the running application at [http://localhost:8080](http://localhost:8080). Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). -* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access Python. Since our scripts are still thinking in terms of unix line seperators, they may look for *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` +* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access the Python executable. Since our scripts are still thinking in terms of unix line seperators, they may look for *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` * If you'd rather not change this globally, add a `.gitattributes` file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) ## Branch Conventions From b4d4b536d9f01f02ec352f700671a629d90acbd1 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Thu, 3 Aug 2023 08:06:35 -0600 Subject: [PATCH 5/9] Made the text a bit more clear --- docs/developer/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developer/README.md b/docs/developer/README.md index 886b435d9..2c129b5fa 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -18,8 +18,8 @@ If you're new to Django, see [Getting Started with Django](https://www.djangopro Visit the running application at [http://localhost:8080](http://localhost:8080). -Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). -* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access the Python executable. Since our scripts are still thinking in terms of unix line seperators, they may look for *'python\r'* rather than *python* since Windows cannot read the carriage return on its own - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` +Note: If you are using Windows, you may need to change your [line endings](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings). If not, you may not be able to run manage.py. +* Unix based operating systems (like macOS or Linux) handle line separators [differently than Windows does](https://superuser.com/questions/374028/how-are-n-and-r-handled-differently-on-linux-and-windows). This can break bash scripts in particular. In the case of manage.py, it uses *#!/usr/bin/env python* to access the Python executable. Since the script is still thinking in terms of unix line seperators, it may look for the executable *python\r* rather than *python* (since Windows cannot read the carriage return on its own) - thus leading to the error `usr/bin/env: 'python\r' no such file or directory` * If you'd rather not change this globally, add a `.gitattributes` file in the project root with `* text eol=lf` as the text content, and [refresh the repo](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings) ## Branch Conventions From e69b800f59dd4382bf0431c1717929098779b7d6 Mon Sep 17 00:00:00 2001 From: Alysia Broddrick Date: Mon, 7 Aug 2023 08:47:52 -0700 Subject: [PATCH 6/9] Add new developer sandbox 'rh' infrastructure --- .github/workflows/migrate.yaml | 1 + .github/workflows/reset-db.yaml | 1 + ops/manifests/manifest-rh.yaml | 29 +++++++++++++++++++++++++++++ src/registrar/config/settings.py | 1 + 4 files changed, 32 insertions(+) create mode 100644 ops/manifests/manifest-rh.yaml diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index 28447a605..dcd7eee66 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -15,6 +15,7 @@ on: options: - stable - staging + - rh - gd - rb - ko diff --git a/.github/workflows/reset-db.yaml b/.github/workflows/reset-db.yaml index 0d3ed4934..e5af08808 100644 --- a/.github/workflows/reset-db.yaml +++ b/.github/workflows/reset-db.yaml @@ -16,6 +16,7 @@ on: options: - stable - staging + - rh - gd - rb - ko diff --git a/ops/manifests/manifest-rh.yaml b/ops/manifests/manifest-rh.yaml new file mode 100644 index 000000000..d8bf4cb77 --- /dev/null +++ b/ops/manifests/manifest-rh.yaml @@ -0,0 +1,29 @@ +--- +applications: +- name: getgov-rh + buildpacks: + - python_buildpack + path: ../../src + instances: 1 + memory: 512M + stack: cflinuxfs4 + timeout: 180 + command: ./run.sh + health-check-type: http + health-check-http-endpoint: /health + env: + # Send stdout and stderr straight to the terminal without buffering + PYTHONUNBUFFERED: yup + # Tell Django where to find its configuration + DJANGO_SETTINGS_MODULE: registrar.config.settings + # Tell Django where it is being hosted + DJANGO_BASE_URL: https://getgov-rh.app.cloud.gov + # Tell Django how much stuff to log + DJANGO_LOG_LEVEL: INFO + # default public site location + GETGOV_PUBLIC_SITE_URL: https://beta.get.gov + routes: + - route: getgov-rh.app.cloud.gov + services: + - getgov-credentials + - getgov-rh-database diff --git a/src/registrar/config/settings.py b/src/registrar/config/settings.py index 90918c929..183245e55 100644 --- a/src/registrar/config/settings.py +++ b/src/registrar/config/settings.py @@ -571,6 +571,7 @@ SECURE_SSL_REDIRECT = True ALLOWED_HOSTS = [ "getgov-stable.app.cloud.gov", "getgov-staging.app.cloud.gov", + "getgov-rh.app.cloud.gov", "getgov-gd.app.cloud.gov", "getgov-rb.app.cloud.gov", "getgov-ko.app.cloud.gov", From ac75ac68822ab772a7baf2150ee62dc918955c8e Mon Sep 17 00:00:00 2001 From: Alysia Broddrick Date: Mon, 7 Aug 2023 08:52:53 -0700 Subject: [PATCH 7/9] added to deploy script --- .github/workflows/deploy-sandbox.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-sandbox.yaml b/.github/workflows/deploy-sandbox.yaml index 614484a2a..d7ca9d71a 100644 --- a/.github/workflows/deploy-sandbox.yaml +++ b/.github/workflows/deploy-sandbox.yaml @@ -15,6 +15,7 @@ jobs: || startsWith(github.head_ref, 'rb/') || startsWith(github.head_ref, 'ko/') || startsWith(github.head_ref, 'gd/') + || startsWith(github.head_ref, 'rh/') outputs: environment: ${{ steps.var.outputs.environment}} runs-on: "ubuntu-latest" From 5a7b7164b4ff56a1d8dbed9d03dc24ef12aa9e7f Mon Sep 17 00:00:00 2001 From: Rebecca Hsieh Date: Mon, 7 Aug 2023 11:43:29 -0700 Subject: [PATCH 8/9] Add gpg install link and update assignees --- .github/ISSUE_TEMPLATE/developer-onboarding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/developer-onboarding.md b/.github/ISSUE_TEMPLATE/developer-onboarding.md index 92ae9e3a1..2ea8bcb86 100644 --- a/.github/ISSUE_TEMPLATE/developer-onboarding.md +++ b/.github/ISSUE_TEMPLATE/developer-onboarding.md @@ -3,7 +3,7 @@ name: Developer Onboarding about: Onboarding steps for developers. title: 'Developer Onboarding: GH_HANDLE' labels: dev, onboarding -assignees: loganmeetsworld +assignees: abroddrick --- @@ -16,7 +16,7 @@ assignees: loganmeetsworld There are several tools we use locally that you will need to have. - [ ] [Install the cf CLI v7](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html#pkg-mac) for the ability to deploy -- [ ] Make sure you have `gpg` >2.1.7. Run `gpg --version` to check. +- [ ] Make sure you have `gpg` >2.1.7. Run `gpg --version` to check. If not, [install gnupg](https://formulae.brew.sh/formula/gnupg) - [ ] Install the [Github CLI](https://cli.github.com/) ## Access From 92ed691eb42fd284152eb30dc2762b3abfdbcb32 Mon Sep 17 00:00:00 2001 From: Rebecca Hsieh Date: Mon, 7 Aug 2023 12:05:37 -0700 Subject: [PATCH 9/9] Update for shell rc file --- .github/ISSUE_TEMPLATE/developer-onboarding.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/developer-onboarding.md b/.github/ISSUE_TEMPLATE/developer-onboarding.md index 2ea8bcb86..11b2d86fc 100644 --- a/.github/ISSUE_TEMPLATE/developer-onboarding.md +++ b/.github/ISSUE_TEMPLATE/developer-onboarding.md @@ -80,6 +80,15 @@ You may need to add these two lines to your shell's rc file (e.g. `.bashrc` or ` GPG_TTY=$(tty) export GPG_TTY ``` +and then + +```bash +source ~/.bashrc +``` +or +```bash +source ~/.zshrc +``` ## Setting up developer sandbox