cisagov / manage.get.gov

A Django-based domain name registrar used by the .gov domain to communicate with an EPP registry
https://get.gov
Other
57 stars 17 forks source link

Developer Onboarding: zandercymatics #821

Closed zandercymatics closed 1 year ago

zandercymatics commented 1 year ago

Developer Onboarding

Installation

There are several tools we use locally that you will need to have.

Access

Steps for the onboardee

Steps for the onboarder

Documents to Review

Setting up commit signing

Follow the instructions here to generate a new GPG key (default configurations are okay) and add it to your GPG keys on Github.

Configure your key locally:

git config --global commit.gpgsign true
git config --global user.signingkey <YOUR KEY>

Where your key is the thing you generated to run the command

gpg --armor --export <YOUR KEY>

when setting up your key in Github.

Now test commit signing is working by checking out a branch (yourname/test-commit-signing) and making some small change to a file. Commit the change (it should prompt you for your GPG credential) and push it to Github. Look on Github at your branch and ensure the commit is verified.

Note: if you are on a mac and not able to successfully create a signed commit, getting the following error:

error: gpg failed to sign the data
fatal: failed to write commit object

You may need to add these two lines to your shell's rc file (e.g. .bashrc or .zshrc)

GPG_TTY=$(tty)
export GPG_TTY

Setting up developer sandbox

We have three types of environments: stable, staging, and sandbox. Stable (production)and staging (pre-prod) get deployed via tagged release, and developer sandboxes are given to get.gov developers to mess around in a production-like environment without disrupting stable or staging. Each sandbox is namespaced and will automatically be deployed too when the appropriate branch syntax is used for that space in an open pull request. There are several things you need to setup to make the sandbox work for a developer.

All automation for setting up a developer sandbox is documented in the scripts for creating a developer sandbox and removing a developer sandbox. A Cloud.gov organization administrator will have to perform the script in order to create the sandbox.

zandercymatics commented 1 year ago

Left 'onboarder' blank for now as those details get filled in

abroddrick commented 1 year ago

Perfect just filled it in!

zandercymatics commented 1 year ago

@abroddrick Fixed the directory issue with line-endings. Basically, on windows, you need to add a (local only) .gitattributes file and rebuild the project: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings Is there a good place in the documentation to put this? May be helpful if someone down the line runs into the same error when trying to run manage.py

abroddrick commented 1 year ago

Yes make a PR with that tip and put it in the developer/README.md under the "## Local Setup" portion. Seems like that would be the ideal place. Thanks for finding this!

zandercymatics commented 1 year ago

Can't access the 'team charter' currently as I am not added to the Google Doc

zandercymatics commented 1 year ago

Reopened as I am unsure as to if the originator should close this