Skip to content

Commit

Permalink
Promote staging to production for sprint Sprint K44/Sprint 88 (#1147)
Browse files Browse the repository at this point in the history
* Jdonis/chal 1579 buttons checkbox (#1053)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function

* mix format

* Apetty/chal 1594 implement challenge filter with uswds (#1034) (#1037)

* Update gitignore file to exclude erlang compile folders
* Tune and style challenges filter
* Fine tune date selection logic
* Further tuning filter module for accessibility
* 1. Put form and guidance text in a container div, 2. Updated guidance text, 3. Added aria-label to Keyword or phrase textbox
* Adjust filter full text search to index only on title, tagline, and brief_description
* Remove the word phrase from the filter module and add double quotes to the word 'clear'
* Addressed orphaned form labels
* Make spacing and alignment adjustments requested by Marni
* Restore grey bg that horizontally spans page beneath filter module
* Fix clear button on mobile
* Address additional orphaned form labels for accessibility
* Cherry-picked and merged filter code from staging
* Applied USWDS 2.14.0 styles to filter module
* Added pad above guidance text in filter module
* 1. Moved filter guidance above filter and centered 2. Adjusted multi-select 3. Fixed multi-select issue caused by variance between display a>
* Apetty/chal 1594 implement challenge filter with uswds (#1029)
* removed semicolon from end of ChallengeTiles.js which prevent successful build on main
* Minor update to ChallengeTiles.js, tuned code for linting issue

* Patch for date added dropdown issue in production (#1038)

* Jdonis/chal 1567 usa buttons (#1048)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* buttons fix details

* Jdonis/chal 1568 radio button  (#1049)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* USA-radio button adjustments
* Adjust to work with wallaby test

* Jdonis/chal 1570 search box (#1050)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* USWDS Search component

* Jdonis/chal 1607 input text (#1051)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* usa-input & usa-select
* Adjust template class
* Adjustments to filter & PMO report form

* CHAL-1579 Buttons checkbox USWDS

* mix format

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1580 file input (#1054)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Apetty/chal 1594 implement challenge filter with uswds (#1034) (#1037)
* Update gitignore file to exclude erlang compile folders
* Tune and style challenges filter
* Fine tune date selection logic
* Further tuning filter module for accessibility
* 1. Put form and guidance text in a container div, 2. Updated guidance text, 3. Added aria-label to Keyword or phrase textbox
* Adjust filter full text search to index only on title, tagline, and brief_description
* Remove the word phrase from the filter module and add double quotes to the word 'clear'
* Addressed orphaned form labels
* Make spacing and alignment adjustments requested by Marni
* Restore grey bg that horizontally spans page beneath filter module
* Fix clear button on mobile
* Address additional orphaned form labels for accessibility
* Cherry-picked and merged filter code from staging
* Applied USWDS 2.14.0 styles to filter module
* Added pad above guidance text in filter module
* 1. Moved filter guidance above filter and centered 2. Adjusted multi-select 3. Fixed multi-select issue caused by variance between display a>
* Apetty/chal 1594 implement challenge filter with uswds (#1029)
* removed semicolon from end of ChallengeTiles.js which prevent successful build on main
* Minor update to ChallengeTiles.js, tuned code for linting issue
* Patch for date added dropdown issue in production (#1038)
* Jdonis/chal 1567 usa buttons (#1048)
* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* buttons fix details

* Jdonis/chal 1568 radio button  (#1049)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* USA-radio button adjustments
* Adjust to work with wallaby test

* Jdonis/chal 1570 search box (#1050)

* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* USWDS Search component
* Jdonis/chal 1607 input text (#1051)
* Update to cflinuxfs4 & CircleCI images
* Adding STACK & original elixir buildpack
* Rename imported prize calculation function
* mix format
* Convert buttons to usa-buttons
* usa-buttons migration
* Modification to testing bcs the change in clasess
* Adding btn group to other actions
* usa-input & usa-select
* Adjust template class
* Adjustments to filter & PMO report form
* CHAL-1579 Buttons checkbox USWDS
* mix format
* CHAL-1580 File input USWDS
* Adding error msg and validation for file upload

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1580 file input (#1055)

* CHAL-1580 File input USWDS
* Adding error msg and validation for file upload
* DAP report page - JS code for USWDS file upload

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1580 file input & Orb browser-tools CircleCi (#1056)

* Adding error msg and validation for file upload
* DAP report page - JS code for USWDS file upload
* Clear input after uploading one file
* CircleCi Chrome
* Browser-tools 1.2.5
* Browser-tools 1.4.1
* Browser-tools 1.4.2
* Wallaby path
* Wallaby path fix

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1579 buttons checkbox (#1057)

* fix submission select
* Checkbox reviewed submission
* Browser-tools 1.4.2

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1562 dropdown hover (#1058)

* Dropdown generic
* remove Orbs for testing
* ver 1.4.2 browser-tools
* Adding mix test
* Wallaby path
* Other dropdown
* mix format

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chl 1578 breadcrumb (#1062)


* Dropdown generic
* Mix Format
* chrome 114 ver
* Dropdown hover code
* browser tools
* step indicator USWDS

* add img navigate next

---------

Co-authored-by: Alex Petty <[email protected]>

* preload, max-age, hsts

* preload prod config

* Remove extra configuration (#1066)

* CHAL-1642: Add input validation on challenge contact form using staging as a base (#1071)

* switch callout to usa-alert

* fix tag_error function call

* first modal update

* USWDS Modals

* Component cards USWDS

* Jdonis/CHAL 1571 tables (#1087)

* Jdonis/chal 1643 hsts resolution (#1070)

* preload, max-age, hsts
* preload prod config
* remove extra configuration

* CHAL-1642: Add input validation on challenge contact for prod (#1072)

* first modal update

* USWDS Modals

* switch callout to usa-alert

* fix tag_error function call

* first modal update

* USWDS Modals

* Component cards USWDS

* adjustments margin

* Tables USWDS & Layout cleaning

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1561 dropdown menu large (#1088)

* Jdonis/chal 1643 hsts resolution (#1070)

* preload, max-age, hsts
* preload prod config
* remove extra configuration

* CHAL-1642: Add input validation on challenge contact for prod (#1072)

* first modal update

* USWDS Modals

* switch callout to usa-alert

* fix tag_error function call

* first modal update

* USWDS Modals

* Component cards USWDS

* adjustments margin

* Dropdown-large

* remove data-bs-toggle

---------

Co-authored-by: Alex Petty <[email protected]>

* remove bootstrap from archive page (#1090)

* Jdonis/chal 1574 sidebar and menu (#1095)

* Jdonis/chal 1643 hsts resolution (#1070)
* preload, max-age, hsts
* preload prod config
* remove extra configuration
* CHAL-1642: Add input validation on challenge contact for prod (#1072)
* first modal update
* USWDS Modals
* switch callout to usa-alert
* fix tag_error function call
* first modal update
* USWDS Modals
* Component cards USWDS
* adjustments margin
* Adding USWDS images

* Jdonis/CHAL-1561 dropdown menu large (#1091)

* Dropdown-large
* remove data-bs-toggle

* Tables USWDS & Layout cleaning

* removing sidebar and structure

* layout changes and menu preparation

* copy USWDS assets to the root

* remove old nav panel

* checking case -> end

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1574 sidebar and menu (#1096)

* Jdonis/chal 1643 hsts resolution (#1070)

* preload, max-age, hsts
* preload prod config
* remove extra configuration
* CHAL-1642: Add input validation on challenge contact for prod (#1072)
* first modal update
* USWDS Modals
* switch callout to usa-alert
* fix tag_error function call
* first modal update
* USWDS Modals
* Component cards USWDS
* adjustments margin
* Adding USWDS images
* Jdonis/CHAL-1561 dropdown menu large (#1091)
* Dropdown-large
 remove data-bs-toggle
* Tables USWDS & Layout cleaning
* removing sidebar and structure
* layout changes and menu preparation
* copy USWDS assets to the root
* Remove old nav panel
* checking case -> end
* fixing challenge menu icon

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1639 uswds icons (#1097)

* Jdonis/chal 1643 hsts resolution (#1070)

* preload, max-age, hsts
* preload prod config
* remove extra configuration

* CHAL-1642: Add input validation on challenge contact for prod (#1072)

* first modal update

* USWDS Modals

* switch callout to usa-alert

* fix tag_error function call

* first modal update

* USWDS Modals

* Component cards USWDS

* adjustments margin

* Adding USWDS images

* Jdonis/CHAL-1561 dropdown menu large (#1091)

* Dropdown-large
* remove data-bs-toggle

* Tables USWDS & Layout cleaning

* removing sidebar and structure

* layout changes and menu preparation

* copy USWDS assets to the root

* remove old nav panel

* checking case -> end

* fixing challenge menu icon

* dashboard icons USWDS

* other icons

* mix format

---------

Co-authored-by: Alex Petty <[email protected]>

* Jdonis/chal 1581 bootsrap ref (#1109)

* Jdonis/chal 1643 hsts resolution (#1070)

* preload, max-age, hsts
* preload prod config
* remove extra configuration

* CHAL-1642: Add input validation on challenge contact for prod (#1072)

* first modal update

* USWDS Modals

* switch callout to usa-alert

* fix tag_error function call

* first modal update

* USWDS Modals

* Component cards USWDS

* adjustments margin

* Jdonis/CHAL-1561 dropdown menu large (#1091)

* Dropdown-large
* remove data-bs-toggle

* Tables USWDS & Layout cleaning

* CHAL-1574  , CHAL 1576  - (#1098)

* Adding USWDS images
* Removing sidebar and structure
* Layout changes and menu preparation
* copy USWDS assets to the root
* Remove old nav panel
* checking case -> end
* Fixing challenge menu icon

* Jdonis/chal 1639 uswds icons (#1099)

* Adding USWDS images
* removing sidebar and structure
* layout changes and menu preparation
* copy USWDS assets to the root
* remove old nav panel
* checking case -> end
* fixing challenge menu icon
* dashboard icons USWDS
* other icons
* mix format

* jdonis/CHAL-1581 - Bootstrap references layout  (#1100)

* Adding USWDS images
* removing sidebar and structure
* layout changes and menu preparation
* copy USWDS assets to the root
* remove old nav panel
* checking case -> end
* fixing challenge menu icon
* dashboard icons USWDS
* other icons
* mix format
* dependencies layout

* remove bootstrap from archive page (#1090) (#1101)

* jdonis/CHAL-1639 USWDS icons (#1102)

* Adding USWDS images
* removing sidebar and structure
* layout changes and menu preparation
* copy USWDS assets to the root
* remove old nav panel
* checking case -> end
* fixing challenge menu icon
* dashboard icons USWDS
* other icons
* mix format
* Icons help section

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* Jdonis/chal 1581 bootstrap references layout (#1105)

* Adding USWDS images

* removing sidebar and structure

* layout changes and menu preparation

* copy USWDS assets to the root

* remove old nav panel

* checking case -> end

* fixing challenge menu icon

* dashboard icons USWDS

* other icons

* mix format

* dependencies layout

* add bootstrap ref

* Revert "Jdonis/chal 1581 bootstrap references layout (#1105)" (#1106)

This reverts commit 0fa8c32.

* Bootstrap ref public

* remove bootstrap

* update browser tools

* Chrome driver

* Chrome driver 114

* browser tools 1.4.1

* update first

* Chrome path

---------

Co-authored-by: Alex Petty <[email protected]>

* Update reactjs side styles (#1111)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* post-style-migration tuning of the challenge tiles module

* tuned tabs

* Update reactjs side styles (#1112)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* post-style-migration tuning of the challenge tiles module

* tuned tabs

* tune to resolve svg on staging

* Update reactjs side styles (#1113)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* post-style-migration tuning of the challenge tiles module

* tuned tabs

* tune to resolve svg on staging

* tune to resolve svg on staging with relative paths

* Update reactjs side styles (#1114)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* post-style-migration tuning of the challenge tiles module

* tuned tabs

* tune to resolve svg on staging

* tune to resolve svg on staging with relative paths

* tuning svg path to resolve in staging

* Update reactjs side styles (#1115)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* post-style-migration tuning of the challenge tiles module

* tuned tabs

* tune to resolve svg on staging

* tune to resolve svg on staging with relative paths

* tuning svg path to resolve in staging

* tune url for svg resolution

* remove AdminLTE

* Solving tesging

* Mix format

* Change filter responsive wrap width to 1635px (#1117)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* change filter responsive wrap width to 1635px

* Jdonis/chal 1697 remove lte (#1116)

* CHAL-1581 - Bootstrap ref public (#1107)
* remove AdminLTE
* Solving testing
* Mix format

---------

Co-authored-by: Alex Petty <[email protected]>

* Other conflicts

* Jdonis/chal 1697 remove lte (#1118)

* Fix accordion icons (#1119)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* fix accordion bg icon issue

* Adjustments styles

* Jdonis/chal 1697 remove lte (#1120)

* Center tile image (#1121)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* center image on top of challenge tile

* Fix HTML help pages

* Center tile image (#1123)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* center image on top of challenge tile

* center image on top of challenge tile

* CM help card border

* Remove extra winner label (#1125)

* Apetty/chal 1634 convert archived challenges page from using bootstrap (#1104)

* remove bootstrap from archive page (#1090)

* Fixed alignment on archive dropdown

* remove extra winner label

* CHAL-1697-remove-lte; CHAL-1587 USWDS Icons; CHAL-1698 Promote Frontend; - to PROD (#1127)

* Add export challenges feature to filter (#1133)

* Removed period on module title and changed 'clear' button label to 'clear filter' (#1134)

* Added prize_total to the Challenges JSON object and the filter export CSV file (#1137)

* nodejs 18.17.1

* Recertification fix

* mix format

* Tune challenge filter instructional text (#1142)

* Tune-filter-layout-to-match-intended-design (#1144)

* Tune active challenges report prize field (#1145)

* update readme and devconfig in backend (#1146)

* Tune active challenges report prize field

* Update readme and devconfig in backend

---------

Co-authored-by: Alejandro Donis <[email protected]>
  • Loading branch information
alexspetty and jdonis authored Sep 25, 2023
1 parent 23cc428 commit 64369d1
Show file tree
Hide file tree
Showing 6 changed files with 460 additions and 251 deletions.
168 changes: 168 additions & 0 deletions DEVCONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# ChallengeGov

[![GSA](https://circleci.com/gh/GSA/Challenge_gov.svg?style=svg)](https://app.circleci.com/pipelines/github/GSA/Challenge_gov)

Welcome to the ChallengeGov Data Portal

## Requirements

- [PostgreSQL 10](https://www.postgresql.org/) - database
- [Elixir 1.9](https://elixir-lang.org) - server language
- [Erlang 21.2](https://www.erlang.org/) - server language
- [node.js 11.10](https://nodejs.org/en/) - front end language
- [yarn 1.22.5](https://yarnpkg.com/) - package manager

## Install & Setup

### Requirements

Install PostgreSQL according to your OS of choice, for MacOS [Postgres.app](https://postgresapp.com/) is recommended.

Alternatively, use the Challenge_gov docker-compose file to run psql locally in a container.

```cd docker
docker-compose run --service-ports psql
```

To install Elixir, Erlang, and NodeJS it is recommended to use the [asdf version manager](https://asdf-vm.com/#/). Install instructions are copied here for MacOS, for other OSs see [asdf docs](https://asdf-vm.com/#/core-manage-asdf-vm). This also assumes you have [HomeBrew](https://brew.sh/) installed.

```bash
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.0
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile

brew install \
coreutils automake autoconf openssl \
libyaml readline libxslt libtool unixodbc
```

Once asdf is set up, install each language. NodeJS may require setting up keys, and should display help to guide you.

```bash
asdf plugin-add erlang
asdf install erlang 21.2.5

asdf plugin-add elixir
asdf install elixir 1.8.0

asdf plugin-add nodejs
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 11.13.

asdf plugin-add yarn
asdf install yarn 1.22.5

```

### ChallengeGov Setup

Create the file `config/dev.local.exs` and set a secret key base, and if needed, include local PostgreSQL connection information.
It will look something like (replacing with your local configuration):

```elixir
use Mix.Config

config :challenge_gov, Web.Endpoint,
secret_key_base: "<OUTPUT OF `mix phx.gen.secret`>"

config :challenge_gov, ChallengeGov.Repo,
username: "postgres",
password: "postgres",
database: "challenge_gov_dev",
hostname: "localhost",
pool_size: 10
```

Create the file `config/test.local.exs` and set a secret key base, and if needed, include local PostgreSQL connection information.
It will look something like (replacing with your local configuration):

```elixir
use Mix.Config

config :challenge_gov, Web.Endpoint,
secret_key_base: "<OUTPUT OF `mix phx.gen.secret`>"

config :challenge_gov, ChallengeGov.Repo,
username: "postgres",
password: "postgres",
database: "challenge_gov_test",
hostname: "localhost",
pool_size: 10
```

Start with cloning the application. Once cloned, in your terminal run the following commands inside the cloned folder.

```bash
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile
```

This sets up your basic elixir environment. Next setup the database. The following commands will create and migrate locally, as well as migrate seeds.

Super-Admin (optional) -- If you would like to seed the database with a default super-admin user, please set the following environment variables:

- FIRST_USER_EMAIL
- FIRST_USER_FN
- FIRST_USER_LN

Setup and seed the database

```bash
mix ecto.create
mix ecto.migrate
mix run priv/repo/seeds_updated.exs
```

Once the database is setup, make sure to install javascript dependencies.

```bash
cd assets/
yarn
cd ..
```

Now you can run the server.

```bash
mix phx.server
```

## Development

Gain access to the portal by going to http://localhost:4000/ and clicking on 'Dev Accounts' to select and sign in under different user roles.

## Testing

The ChallengeGov runs each pull request (and every commit on the `master` branch) through CI. Make sure to add tests as you extend the application. We also run [Credo](https://github.com/rrrene/credo) and the built in formatter in CI to ensure code quality.

## Deployment

Passing CI on master deploys to the dev environment via Cloud Foundry as part of the Drone build.

## Importing Data

Run importers in order of Open, Closed, ClosedImported. Afterward set the challlenges_seq_id to the max challenge-id.

Commands to run:

```
$ iex -S mix run
> Mix.Tasks.OpenChallengeImporter.run("")
> Mix.Tasks.ClosedChallengeImporter.run("")
> Mix.Tasks.ClosedImportedChallengeImporter.run("")
```

In psql after imports:

```
SELECT setval('challenges_id_seq', max(id)) FROM challenges;
```

## Learn more about Phoenix

* Official website: http://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Source: https://github.com/phoenixframework/phoenix
182 changes: 35 additions & 147 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,168 +1,56 @@
# ChallengeGov
Challenge.Gov is an open source platform that accepts contributions and feedback from our customers.

[![GSA](https://circleci.com/gh/GSA/Challenge_gov.svg?style=svg)](https://app.circleci.com/pipelines/github/GSA/Challenge_gov)
## Code of Conduct

Welcome to the ChallengeGov Data Portal
Challenge.Gov is committed to building a safe, welcoming, harassment-free culture for everyone. Challenge.Gov is a part of the Technology Transformation Services (TTS) within the General Services Administration (GSA), and we expect everyone to follow the [GSA TTS Code of Conduct](https://handbook.tts.gsa.gov/about-us/code-of-conduct/).

## Requirements
We encourage you to read this platform’s [DEVCONFIG](DEVCONFIG.md), its [LICENSE]( https://github.com/GSA/Challenge_gov/blob/main/LICENSE), and its [README](README.md). If you want to read more about our open source policy or have questions, check out the GSA’s Open Source Policy (https://open.gsa.gov/oss/ or send us an [email](mailto:[email protected]).

- [PostgreSQL 10](https://www.postgresql.org/) - database
- [Elixir 1.9](https://elixir-lang.org) - server language
- [Erlang 21.2](https://www.erlang.org/) - server language
- [node.js 11.10](https://nodejs.org/en/) - front end language
- [yarn 1.22.5](https://yarnpkg.com/) - package manager
## How you can contribute

## Install & Setup
Anyone can contribute to Challenge.Gov. Whether it's notifying us of an issue, proposing a new feature, or suggestions for content or workflow improvements, we welcome your ideas on how to improve this site.

### Requirements
First time contributor? We’re here to help guide you through a successful contribution. We review all contributions before merging them into Challenge.Gov. If you’re unsure about anything, just ask (mailto:[email protected]).

Install PostgreSQL according to your OS of choice, for MacOS [Postgres.app](https://postgresapp.com/) is recommended.
Before submitting a contribution, you’ll just need to create a GitHub account or sign in to your existing account.

Alternatively, use the Challenge_gov docker-compose file to run psql locally in a container.
## Submitting bugs and issues

```cd docker
docker-compose run --service-ports psql
```
If something isn’t working the way it's supposed to:

To install Elixir, Erlang, and NodeJS it is recommended to use the [asdf version manager](https://asdf-vm.com/#/). Install instructions are copied here for MacOS, for other OSs see [asdf docs](https://asdf-vm.com/#/core-manage-asdf-vm). This also assumes you have [HomeBrew](https://brew.sh/) installed.
Email (mailto:[email protected]) and document how to reproduce the bug. Before submitting a bug, try to recreate it and document the steps we can take to reproduce it. If you can, take screen shots to capture specific details about the bug. This helps us understand its context. We can only fix bugs that we're able to understand and reproduce.

```bash
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.0
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
## To Contribute to fixing bugs, developing features and enhancements

brew install \
coreutils automake autoconf openssl \
libyaml readline libxslt libtool unixodbc
```
Before submitting a contribution, you’ll just need to create a GitHub account or sign in to your existing account.

Once asdf is set up, install each language. NodeJS may require setting up keys, and should display help to guide you.
Fork this repo into your GitHub account. Read more about forking a repo on [GitHub](https://help.github.com/articles/fork-a-repo/).
Create a branch from `production` and name it in a way that lightly defines what you’re working on (for example, `add-styles`).
Once you’re ready to submit a pull request, fill out the [pull request template (https://github.com/GSA/Challenge_gov/compare)
Submit your pull request against the `main` branch.

```bash
asdf plugin-add erlang
asdf install erlang 21.2.5
If the pull request is accepted, we will merge the pull request for you.

asdf plugin-add elixir
asdf install elixir 1.8.0
## How we prioritize

asdf plugin-add nodejs
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 11.13.
Once you’ve submitted a contribution, we'll review the code and triage it based on the following considerations:
1. **Severity:** What type of functionality is impacted? Is there a workaround?
2. **Priority:** Does this align with our vision and roadmap goals?
3. **Size:** Can we accomplish this in a 2 week sprint or will this take longer?

asdf plugin-add yarn
asdf install yarn 1.22.5
Note: We prioritize issues that affect accessibility, user experience, and system security.

```
These considerations help us decide if and when we can work on the issue. If the issue is accepted, we will schedule them for an upcoming 2-week sprint.

### ChallengeGov Setup
## Common terms

Create the file `config/dev.local.exs` and set a secret key base, and if needed, include local PostgreSQL connection information.
It will look something like (replacing with your local configuration):
There can be a lot of jargon when discussing how you can contribute to Challenge.Gov. We’ve included some common terms we use below.

```elixir
use Mix.Config

config :challenge_gov, Web.Endpoint,
secret_key_base: "<OUTPUT OF `mix phx.gen.secret`>"

config :challenge_gov, ChallengeGov.Repo,
username: "postgres",
password: "postgres",
database: "challenge_gov_dev",
hostname: "localhost",
pool_size: 10
```

Create the file `config/test.local.exs` and set a secret key base, and if needed, include local PostgreSQL connection information.
It will look something like (replacing with your local configuration):

```elixir
use Mix.Config

config :challenge_gov, Web.Endpoint,
secret_key_base: "<OUTPUT OF `mix phx.gen.secret`>"

config :challenge_gov, ChallengeGov.Repo,
username: "postgres",
password: "postgres",
database: "challenge_gov_test",
hostname: "localhost",
pool_size: 10
```

Start with cloning the application. Once cloned, in your terminal run the following commands inside the cloned folder.

```bash
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile
```

This sets up your basic elixir environment. Next setup the database. The following commands will create and migrate locally, as well as migrate seeds.

Super-Admin (optional) -- If you would like to seed the database with a default super-admin user, please set the following environment variables:

- FIRST_USER_EMAIL
- FIRST_USER_FN
- FIRST_USER_LN

Setup and seed the database

```bash
mix ecto.create
mix ecto.migrate
mix run priv/repo/seeds_updated.exs
```

Once the database is setup, make sure to install javascript dependencies.

```bash
cd assets/
yarn
cd ..
```

Now you can run the server.

```bash
mix phx.server
```

## Development

Gain access to the portal by going to http://localhost:4000/ and clicking on 'Dev Accounts' to select and sign in under different user roles.

## Testing

The ChallengeGov runs each pull request (and every commit on the `master` branch) through CI. Make sure to add tests as you extend the application. We also run [Credo](https://github.com/rrrene/credo) and the built in formatter in CI to ensure code quality.

## Deployment

Passing CI on master deploys to the dev environment via Cloud Foundry as part of the Drone build.

## Importing Data

Run importers in order of Open, Closed, ClosedImported. Afterward set the challlenges_seq_id to the max challenge-id.

Commands to run:

```
$ iex -S mix run
> Mix.Tasks.OpenChallengeImporter.run("")
> Mix.Tasks.ClosedChallengeImporter.run("")
> Mix.Tasks.ClosedImportedChallengeImporter.run("")
```

In psql after imports:

```
SELECT setval('challenges_id_seq', max(id)) FROM challenges;
```

## Learn more about Phoenix

* Official website: http://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Source: https://github.com/phoenixframework/phoenix
- **Bug** - problem resulting in something not working properly or as expected.
- **Enhancement** - a proposal to make something existing work better.
- **Feature request** - a proposal for something new to be added to the system.
- **Fork** - a copy of a repository that you manage.
- **Open source** - something that can be viewed, modified, and shared by anyone in the public with permissions enforced through an open source license.
- **Pull request** - a way to notify project team members when a contributor/developer wants to merge new code changes into a main project repository. You can read more on GitHub, (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).
- **Repository (aka repo)** - In Github, a repository contains all your projects’ files and each of their revisions. You can read more on GitHub (https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories).
- **Roadmap** - a summary that outlines a product’s goals, priorities, and progress over a period of time.
Loading

0 comments on commit 64369d1

Please sign in to comment.