From 9276049ab0dad68378f7f3418da4ef6d1e203d1d Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:10:00 -0700 Subject: [PATCH 1/7] TCA-548 #comment This commit adds more details about branching and PRs #time 15m --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 99c047b60..9343fe160 100644 --- a/README.md +++ b/README.md @@ -319,15 +319,31 @@ The PlatformRoute model has several useful options: ## Git +### Pull Requests + +If a Jira ticket if requires any code changes, it should have its own pull request. + +PRs should be named as follows: + +`[TICKET-###] [Short Description] -> [target-branch-name]` + +e.g. `GAME-174 Upload Badge Image Fix -> dev` + ### Branching -When working on Jira tickets, we link associated Git PRs and branches to the tickets. Use the following naming convention for branches: -`[TICKET #]_short-description` +All branches use `dev` as their source. All merges to `dev` should be made via [pull request](#pull-requests) and should be approved by application owner(s). + +When working on Jira tickets, a branch should correspond with a single ticket. + +When using subtasks, each parent ticket should have its own branch off `dev`, and all subtasks branches should be merged into the parent ticket branch instead of directly to `dev`. + +Use the following naming convention for branches in order to link associated Git PRs and branches to the tickets: + +`[TICKET-###]_short-description` e.g.: `PROD-1516_work-issue` #### Branching strategy -TBD ### Commits We use [Smart Commits](https://bigbrassband.com/git-integration-for-jira/documentation/smart-commits.html#bbb-nav-basic-examples) to link comments and time tracking to tickets. You would enter the following as your commit message: From 94172d4f37623ad415486e85ec14a7dd7d1e05c0 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:11:40 -0700 Subject: [PATCH 2/7] TCA-548 more readme updates #time 5m --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9343fe160..fe55e726e 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,8 @@ PRs should be named as follows: e.g. `GAME-174 Upload Badge Image Fix -> dev` +PRs should also have description that includes a link to the Jira ticket and a summary of what the PR is changing. + ### Branching All branches use `dev` as their source. All merges to `dev` should be made via [pull request](#pull-requests) and should be approved by application owner(s). From 2f4eb47e6c906b070aeacbce5ff0e1b26eef96f7 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:12:17 -0700 Subject: [PATCH 3/7] TCA-548 typo #time 5m --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe55e726e..d8f0974ed 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ PRs should be named as follows: e.g. `GAME-174 Upload Badge Image Fix -> dev` -PRs should also have description that includes a link to the Jira ticket and a summary of what the PR is changing. +PRs should also have a description that includes a link to the Jira ticket and a summary of what the PR is changing. ### Branching From bd3b3043bec4d99d86d0197a194f527b864db1c6 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:47:39 -0700 Subject: [PATCH 4/7] TCA-548 #comment This commit adds README details for each tool #time 15m --- README.md | 182 ++++++++++++++-------- src-ts/tools/dev-center/README.md | 11 +- src-ts/tools/gamification-admin/README.md | 3 + src-ts/tools/work/README.md | 3 + 4 files changed, 129 insertions(+), 70 deletions(-) create mode 100644 src-ts/tools/gamification-admin/README.md create mode 100644 src-ts/tools/work/README.md diff --git a/README.md b/README.md index d8f0974ed..5cd650f9f 100644 --- a/README.md +++ b/README.md @@ -6,25 +6,75 @@ All future user interfaces at Topcoder will be implemented here. Pre-existing us >**NOTE:** The information in this file describes our coding standards and best practices. All new code should follow these guidelines both when coding new features as well as porting old features. Please take the time to read through this file in detail. -# Getting started with local development +- [Source Control & CI/CD](#source-control--cicd) +- [Local Development](#local-development) +- [Application Structure](#application-structure) +- [Coding Practices](#coding-practices) +- [Tools](#tools) + +--- + +# Source Control & CI/CD -- [Local Environment Setup](#local-environment-setup) - [Deployments](#deployments) -- [Developer Center specific setup](#developer-center-contentful-api-key-and-space-id) -- [Yarn Commands](#yarn-commands) +- [Pull Requests](#pull-requests) +- [Branching](#branching) +- [Commits](#commits) -# Application structure +## Deployments -- [Folder Structure](#folder-structure) -- [Adding a Tool or Util](#adding-a-tool-or-util) +The app uses CircleCI for CI/CD. -# Coding Practices -- [Git](#git) -- [Linting](#linting) -- [Styling](#styling) -- [Icons](#icons) +The `dev` branch is auto-deployed to the dev environment: https://platform-mvp.topcoder-dev.com. ---- +The `master` branch is auto-deployed to the production environment: https://platform-ui.topcoder.com. + +## Pull Requests + +If a Jira ticket if requires any code changes, it should have its own pull request. + +PRs should be named as follows: + +`[TICKET-###] [Short Description] -> [target-branch-name]` + +e.g. `GAME-174 Upload Badge Image Fix -> dev` + +PRs should also have a description that includes a link to the Jira ticket and a summary of what the PR is changing. + +## Branching + +All branches use `dev` as their source. All merges to `dev` should be made via [pull request](#pull-requests) and should be approved by application owner(s). + +When working on Jira tickets, a branch should correspond with a single ticket. + +When using subtasks, each parent ticket should have its own branch off `dev`, and all subtasks branches should be merged into the parent ticket branch instead of directly to `dev`. + +Use the following naming convention for branches in order to link associated Git PRs and branches to the tickets: + +`[TICKET-###]_[short-description]` + +e.g.: `PROD-1516_work-issue` + +## Commits +We use [Smart Commits](https://bigbrassband.com/git-integration-for-jira/documentation/smart-commits.html#bbb-nav-basic-examples) to link comments and time tracking to tickets. You would enter the following as your commit message: + +`[TICKET #] #comment #time ` + +e.g.: `PROD-001 #comment adding readme notes #time 45m` + + + + + + + + + +# Local Development + +- [Local Environment Setup](#local-environment-setup) +- [Developer Center specific setup](#developer-center-contentful-api-key-and-space-id) +- [Yarn Commands](#yarn-commands) ## Local Environment Setup @@ -127,28 +177,6 @@ Otherwise, you will need to override the exception each time you load the site. 3. Set the REACT_APP_HOST_ENV=[hostname] 4. Add "start:[hostname]": "sh start-ssl-[hostname].sh" to scripts in package.json -## Deployments - -The app uses CircleCI for CI/CD. - -The "dev" branch is auto-deployed to the dev environment: https://platform-mvp.topcoder-dev.com. - -The "master" branch is auto-deployed to the production environment: https://platform-ui.topcoder.com. - -## Developer Center Contentful API Key and Space Id - -The app requires two environment variables, which contain the space id and the key used to access contentful and retrieve Thrive Articles. - -You should create a file named `.env` in the root folder, and write inside the following lines: - -```sh -REACT_APP_CONTENTFUL_EDU_SPACE_ID= -REACT_APP_CONTENTFUL_EDU_CDN_API_KEY= -``` - -We should use the same space ID and API Key as Topcoder Thrive, these are for fetching Thrive articles and videos in the landing page. - -See the [Dev Center README](/src-ts/tools/dev-center/README.md) for further instructions on setting up the Dev Center. ## yarn Commands @@ -169,6 +197,15 @@ See the [Dev Center README](/src-ts/tools/dev-center/README.md) for further inst | `yarn report:coverage`| Generate e2e coverage report in html format | | `yarn report:coverage:text` | Generate e2e coverage report in text format | + + + + +# Application Structure + +- [Folder Structure](#folder-structure) +- [Adding a Tool or Util](#adding-a-tool-or-util) + ## Folder Structure The folder structure of the app has the following goals: @@ -317,44 +354,14 @@ The PlatformRoute model has several useful options: | `title: string` | The title property is the text that will appear in the Tools or Utils Selectors (this is irrelevant on hidden routes). | | `rolesRequired: Array` | Requiring roles for a route means that users who do not own the roles will be presented with restricted page when they try to access the route. | -## Git - -### Pull Requests - -If a Jira ticket if requires any code changes, it should have its own pull request. - -PRs should be named as follows: - -`[TICKET-###] [Short Description] -> [target-branch-name]` - -e.g. `GAME-174 Upload Badge Image Fix -> dev` - -PRs should also have a description that includes a link to the Jira ticket and a summary of what the PR is changing. - -### Branching - -All branches use `dev` as their source. All merges to `dev` should be made via [pull request](#pull-requests) and should be approved by application owner(s). - -When working on Jira tickets, a branch should correspond with a single ticket. - -When using subtasks, each parent ticket should have its own branch off `dev`, and all subtasks branches should be merged into the parent ticket branch instead of directly to `dev`. - -Use the following naming convention for branches in order to link associated Git PRs and branches to the tickets: - -`[TICKET-###]_short-description` - -e.g.: `PROD-1516_work-issue` - -#### Branching strategy -### Commits -We use [Smart Commits](https://bigbrassband.com/git-integration-for-jira/documentation/smart-commits.html#bbb-nav-basic-examples) to link comments and time tracking to tickets. You would enter the following as your commit message: - -`[TICKET #] #comment #time ` -e.g.: `PROD-001 #comment adding readme notes #time 45m` +# Coding Practices +- [Linting](#linting) +- [Styling](#styling) +- [Icons](#icons) ## Linting ### Rules @@ -567,3 +574,40 @@ e.g.: ``` >**NOTE** - all SVGs require explicit `width` and `height` in the Safari browser in order to be rendered properly, otherwise they'll be rendered to the _default_ size and probably will crop out of view + +# Tools + +The following summarizes the various [tools](#adding-a-tool-or-util) in the Platform UI. + +- [Dev Center](#dev-center) +- [Gamification Admin](#gamification-admin) +- [Learn](#learn) +- [Work](#work) + +## Dev Center + +A community-led project to document how to work with Topcoder internal applications. + +[Dev Center README](./src-ts/tools/dev-center/README.md) +[Dev Center Routes](./src-ts/tools/dev-center/dev-center.routes.tsx) + +## Gamification Admin + +Application that allows administrators to CRUD badges and de/assign them to specific users. + +[Gamification Admin README TBD](./src-ts/tools/gamification-admin/README.md) +[Gamification Admin Routes](./src-ts/tools/gamification-admin/gamification-admin.routes.tsx) + +## Learn + +Application that serves 3rd-party educational content. + +[Learn README](./src-ts/tools/learn/README.md) +[Learn Routes](./src-ts/tools/learn/learn.routes.tsx) + +## Work + +Application that allows customers to submit/start challenges self-service. + +[Work README TBD](./src-ts/tools/work/README.md) +[Work Routes](./src-ts/tools/work/work.routes.tsx) diff --git a/src-ts/tools/dev-center/README.md b/src-ts/tools/dev-center/README.md index 93bb74b26..adde14a01 100644 --- a/src-ts/tools/dev-center/README.md +++ b/src-ts/tools/dev-center/README.md @@ -1,6 +1,15 @@ # Dev Center Configuration -See the [main app README](/README.md#developer-center-contentful-api-key-and-space-id) for info regarding the environment variables required to run the DEV Center. +The app requires two environment variables, which contain the space id and the key used to access contentful and retrieve Thrive Articles. + +You should create a file named `.env` in the root folder, and write inside the following lines: + +```sh +REACT_APP_CONTENTFUL_EDU_SPACE_ID= +REACT_APP_CONTENTFUL_EDU_CDN_API_KEY= +``` + +We should use the same space ID and API Key as Topcoder Thrive, these are for fetching Thrive articles and videos in the landing page. ## Landing page diff --git a/src-ts/tools/gamification-admin/README.md b/src-ts/tools/gamification-admin/README.md new file mode 100644 index 000000000..6f990d4e5 --- /dev/null +++ b/src-ts/tools/gamification-admin/README.md @@ -0,0 +1,3 @@ +# Gamification Admin Tool + +TBD diff --git a/src-ts/tools/work/README.md b/src-ts/tools/work/README.md new file mode 100644 index 000000000..cf2769837 --- /dev/null +++ b/src-ts/tools/work/README.md @@ -0,0 +1,3 @@ +# Work Tool + +TBD From dcd00847706407f4ec71ffc85e53b76455605455 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:55:18 -0700 Subject: [PATCH 5/7] TCA-548 clean up #time 5m --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cd650f9f..b0d954c66 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ e.g.: `PROD-001 #comment adding readme notes #time 45m` # Local Development - [Local Environment Setup](#local-environment-setup) -- [Developer Center specific setup](#developer-center-contentful-api-key-and-space-id) +- [Tool-specific Setup](#tool-specific-setup) - [Yarn Commands](#yarn-commands) ## Local Environment Setup @@ -178,6 +178,10 @@ Otherwise, you will need to override the exception each time you load the site. 4. Add "start:[hostname]": "sh start-ssl-[hostname].sh" to scripts in package.json +## Tool-specific setup + +Each [Tool](#tools) can have its own setup requirements. Please see each tool's [README](#tools) for further information. + ## yarn Commands | Command | Description | @@ -575,6 +579,13 @@ e.g.: >**NOTE** - all SVGs require explicit `width` and `height` in the Safari browser in order to be rendered properly, otherwise they'll be rendered to the _default_ size and probably will crop out of view + + + + + + + # Tools The following summarizes the various [tools](#adding-a-tool-or-util) in the Platform UI. From e888068d2100ea5750b60bc8b3171a9f7c8fe445 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 14:57:51 -0700 Subject: [PATCH 6/7] TCA-548 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b0d954c66..a6d0254c7 100644 --- a/README.md +++ b/README.md @@ -366,6 +366,7 @@ The PlatformRoute model has several useful options: - [Linting](#linting) - [Styling](#styling) - [Icons](#icons) + ## Linting ### Rules From a0583e059f428269532d782aff910caf6f45fd3a Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 17 Oct 2022 15:22:57 -0700 Subject: [PATCH 7/7] TCA-548 typo #time 10m --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6d0254c7..1cd487a54 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The `master` branch is auto-deployed to the production environment: https://plat ## Pull Requests -If a Jira ticket if requires any code changes, it should have its own pull request. +If a Jira ticket requires any code changes, it should have its own pull request. PRs should be named as follows: