From 63850b5f061304b1a74254d509ecb8608122d5f2 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 15 Jun 2024 01:58:22 +0400 Subject: [PATCH 01/11] tidy README.md #280 --- README.md | 110 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 41c49cc..2bdb974 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,32 @@ +
+ # ๐Ÿท Labels +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dwyl/labels/ci.yml?label=build&style=flat-square&branch=main) +[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/labels/main.svg?style=flat-square)](http://codecov.io/github/dwyl/labels?branch=main) +[![contributions welcome](https://img.shields.io/badge/feedback-welcome-brightgreen.svg?style=flat-square)](https://github.com/dwyl/labels/issues) [![HitCount](https://hits.dwyl.com/dwyl/labels.svg?style=flat-square)](https://hits.dwyl.com/dwyl/labels) -[![Elixir CI](https://github.com/dwyl/labels/actions/workflows/ci.yml/badge.svg)](https://github.com/dwyl/labels/actions/workflows/ci.yml) -See it in action: https://labels.fly.dev/ +Try it: [labels.fly.dev](https://labels.fly.dev/) + +
-## What? +## What? ๐Ÿ’ญ -Gui application to copy labels from one repo to another. +A Web App to copy `GitHub` labels from one repo to another. -## Why? +## Why? ๐Ÿคทโ€โ™€๏ธ -Having a standard list of labels across all of your projects means that you can -move between repositories quickly and effectively. *However*, manually adding -labels to a new GitHub repository can become old, ***fast***. This module aims -to **save you time** by automating the addition of labels to a new project by -copying them from a selected repo and then transferring them to a target repo. +Having a standard list of `labels` across all of your projects +means you can move between repositories quickly +and effectively. +*However*, manually adding labels +to a new `GitHub` repository can become old, ***fast***. +This module aims to **save you time** +by automating the addition of `labels` +to a `new` project +by copying them from a selected repo +and creating them on the target repo. Our main criteria is that it ***MUST*** be quicker than manually adding labels and will offer a [hosted version](https://labels.fly.dev/) @@ -41,9 +52,11 @@ explaining the status of an issue. It also allows us to communicate quickly with our clients as they know when to test and approve/reject a feature with the label **`please-test`**. -## Who? +## Who? -Any Github user who has created multiple repositories and values their time โฐ +Any `person` that uses `GitHub` +and has multiple repos they want to keep `labels` consistent across. +i.e: values their time! โฐ ## How? @@ -65,46 +78,75 @@ the colour will change to match the source repo. Other than this, it will simply add any labels that don't already exist and won't touch the existing ones. -## Run +## Run the App! + +To run the `labels` app on your `localhost`, +follow these steps: + +### 1. Clone the project + +```sh +git clone git@github.com:dwyl/labels.git && cd labels +``` + +### 2. Install dependencies +```sh +mix setup +``` -#### Config +### 3. Configure Environment Variables -Since we are using [elixir-auth-github](https://github.com/dwyl/elixir-auth-github) -you will need to follow some of their setup to run the project locally. - + You need to create a new oauth application in your github but please see - [create-a-github-app-and-oauth2-credentials](https://github.com/dwyl/elixir-auth-github/#2-create-a-github-app-and-oauth2-credentials-) - + You will need to create a +> `labels` uses +[`elixir-auth-github`](https://github.com/dwyl/elixir-auth-github) +for authentication, +follow the instructions in: +[create-a-github-app-and-oauth2-credentials](https://github.com/dwyl/elixir-auth-github/#2-create-a-github-app-and-oauth2-credentials-) +to get your `GitHub` Auth keys. + + Create an [.env](https://github.com/dwyl/learn-environment-variables) - file root or project of the form: + file root or project with the two variables: ```sh GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= ``` -#### To run: +Once you've added the environment variables to the `.env` file +and saved the file, +run the command: + +```sh +source .env +``` + +### 4. Run the App + +```sh +mix s +``` + +Now visit: +[localhost:4000](http://localhost:4000/) +in your web browser. + -Enter these commands into your terminal: -* `git clone https://github.com/dwyl/labels.git` -* `cd labels` -* `source .env` -* `mix deps.get` -* `mix phx.server` -* Visit http://localhost:4000/ ## Labels -This repository contains our 'master list' of labels used across all dwyl projects: -[https://www.github.com/dwyl/labels/labels](github.com/dwyl/labels/labels) +This repository is "[single source of truth](https://en.wikipedia.org/wiki/Single_source_of_truth)" +of labels used across all `@dwyl` projects: +[github.com/dwyl/labels/labels](github.com/dwyl/labels/labels) An explanation of each can be found below, -starting with the custom dwyl labels, +starting with the _custom_ dwyl labels, which we use in conjunction with our [contributing process/guidelines](https://www.github.com/dwyl/contributing). -Clicking on a label will take you to an issue with further discussion on its existence and meaning: +Clicking on a label will take you to an issue +with further discussion on its existence and meaning: - [`awaiting-review`](https://github.com/dwyl/labels/issues/49) #f39c12 - added to _issue_ once a PR with its resolution has been assigned to a reviewer (replaces `in-progress`) - [`chore`](https://github.com/dwyl/labels/issues/37) #3A2716 - routine tasks that must be done for every project but require little active brain power @@ -146,10 +188,10 @@ _(NB. if you'd like to see where dwyl is in need of a helping hand, check out ht - `wontfix` #ffffff - when an issue won't be addressed (add a comment to the issue as to *why* this is the case -## Questions/Suggestions +## Feedback / Questions / Suggestions ๐Ÿ™ We hope you find the application useful! We really want to make the process of setting up a repo as fast as possible so hope this helps. If you need something cleared up, have any requests or want to offer any improvements then please [create an issue](https://github.com/dwyl/labels/issues/new). - **Note** It also would be great to hear, via issue, your thoughts on our existing set of labels plus your own favourites :smiley: + **Note** It also would be great to hear your thoughts on our existing set of labels plus your own favourites ๐Ÿ˜Š From 04a99a4b647882b98e204af02a702859524917fb Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 15 Jun 2024 13:43:37 +0400 Subject: [PATCH 02/11] create .env_sample to show example ... --- .env_sample | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .env_sample diff --git a/.env_sample b/.env_sample new file mode 100644 index 0000000..1a4f781 --- /dev/null +++ b/.env_sample @@ -0,0 +1,2 @@ +export GITHUB_CLIENT_ID=your-client-id-here +export GITHUB_CLIENT_SECRET=secret-here \ No newline at end of file From ab5908df3b2c9bb6e80d8ac489d48f8b7aceda39 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 15 Jun 2024 13:48:14 +0400 Subject: [PATCH 03/11] add apple touch icons to avoid noisy warnings/erros see: https://github.com/dwyl/who/issues/172 --- .../templates/layout/icons.html.heex | 84 +++++++++++++++++++ .../templates/layout/root.html.heex | 1 + 2 files changed, 85 insertions(+) create mode 100644 lib/labels_web/templates/layout/icons.html.heex diff --git a/lib/labels_web/templates/layout/icons.html.heex b/lib/labels_web/templates/layout/icons.html.heex new file mode 100644 index 0000000..c26826c --- /dev/null +++ b/lib/labels_web/templates/layout/icons.html.heex @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/labels_web/templates/layout/root.html.heex b/lib/labels_web/templates/layout/root.html.heex index 121fdb7..541d76f 100644 --- a/lib/labels_web/templates/layout/root.html.heex +++ b/lib/labels_web/templates/layout/root.html.heex @@ -6,6 +6,7 @@ <%= csrf_meta_tag() %> <%= live_title_tag(assigns[:page_title] || "Labels", suffix: " ยท Phoenix Framework") %> + <%= render("icons.html") %>