-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add/BasePage_297_1_2' into add/Timeline_Tests_296_Tests…
…_1_2
- Loading branch information
Showing
80 changed files
with
2,459 additions
and
1,414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# solves issues with stylis-plugin-rtl : https://github.com/styled-components/stylis-plugin-rtl/issues/35#issuecomment-1550877823 | ||
GENERATE_SOURCEMAP=false | ||
GENERATE_SOURCEMAP=false | ||
VITE_BASE_PATH=https://open-bus-stride-api.hasadna.org.il |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Lint PR' | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Preview | ||
on: | ||
pull_request: | ||
|
||
env: | ||
ASSET_URL: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }} | ||
should_run: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | ||
jobs: | ||
should_run: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_run: ${{ steps.set_should_run.outputs.should_run }} | ||
steps: | ||
- name: Set should_run | ||
id: set_should_run | ||
if: env.should_run | ||
run: echo "::set-output name=should_run::true" | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [should_run] | ||
if: ${{ needs.should_run.outputs.should_run == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- name: Run install | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
- name: Build | ||
run: yarn build | ||
- name: upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
build-storybook: | ||
runs-on: ubuntu-latest | ||
needs: [should_run] | ||
if: ${{ needs.should_run.outputs.should_run == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- name: Run install | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
- name: Build Storybook | ||
run: yarn build-storybook -o dist/storybook | ||
- name: upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
deploy-to-s3: | ||
needs: [build, build-storybook] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
- uses: shallwefootball/s3-upload-action@master | ||
name: Upload trace to S3 | ||
if: always() | ||
id: s3-trace | ||
continue-on-error: true | ||
with: | ||
aws_key_id: ${{ secrets.AWS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | ||
aws_bucket: noam-gaash.co.il | ||
source_dir: dist | ||
destination_dir: ${{ github.run_id }}/open-bus/${{ github.sha }} | ||
- name: find comment | ||
uses: peter-evans/find-comment@v1 | ||
if: github.event_name == 'pull_request' | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: 'Preview' | ||
- name: update comment | ||
uses: peter-evans/create-or-update-comment@v1 | ||
if: steps.fc.outputs.comment-id | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
edit-mode: replace | ||
body: | | ||
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html | ||
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html | ||
- name: create comment | ||
uses: peter-evans/create-or-update-comment@v1 | ||
if: steps.fc.outputs.comment-id == '' | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html | ||
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
release-type: node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Contribution Guidelines | ||
|
||
Hello :wave: and welcome to **דאטאבוס**, a project of [hasadna](https://open-bus-map-search.hasadna.org.il)! | ||
|
||
We glad to see you decided to contribute to our project! | ||
|
||
[Join our discord](https://discord.gg/deBdkmufS4) to get connected with the project's development team. | ||
|
||
# Where to start | ||
|
||
You welcome to explore the [list of project's issues](https://github.com/hasadna/open-bus-map-search/issues), the points we need help with | ||
Some of them marked with `help wanted` or `good first issue` - can be good for a beginners | ||
|
||
Also! you can look at the project and if you find some point that can be improved (it can be unclear documentation as well as UI or backend problem) - you wellcome to add issue to the project issues (which considers a contribution too) | ||
|
||
# Starting your environment | ||
|
||
- Fork the Repository on GitHub (by pressing `fork` button) | ||
- Clone the Repository on your machine (`git clone https://github.com/<YOUR NAME>/open-bus-map-search`) | ||
- Define your fork as remote - `git remote set-url origin https://github.com/<YOUR NAME>/open-bus-map-search` | ||
- Install dependencies `yarn` | ||
- Run dev server `yarn start` | ||
|
||
# How to open the PR | ||
|
||
- If you're new to GitHub, here is a [tutorial describing Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). | ||
- create a branch | ||
- branch better to be named after issue (or feature) it tries so solve, e.g. `feat/add-close-button-to-modal` | ||
- Please make sure that the project works on your computer | ||
- do changes and then - do commit (`git commit -m "feat: add some feature"`) | ||
- push the branch to remote repo (`git push`) | ||
- go to the original repo and create a pr (by pressing `create a pr` button) | ||
- tag one of the maintainers as reviewers | ||
|
||
|
||
# Commit message convention | ||
|
||
- commit messages better to be short and explain clearly what the change is about | ||
- `fix` change that tries to fix some bug, e.g. `fix: make close button visible at mobile` | ||
- `feat` change that add some new functionality, e.g. `feat: add a modal component` | ||
- `docs` change that adds some documentation, e.g. `docs: add project description at readme` | ||
- `reafctor` change that makes the code better, e.g. `reafctor: split App component to subcomponents` | ||
- `chore` all the other things `chore: upgrade react package to new 18 version` | ||
|
||
## testing the project: | ||
|
||
### tests beter to be run locally | ||
|
||
| command | description | | ||
| ------------------- | --------------------------------------------------------------- | | ||
| `yarn test:unit` | Run the unit tests using `watch` option (good for development). | | ||
| `yarn test:unit:ci` | Run the unit tests (good for ci). | | ||
| `yarn test:e2e` | Run the e2e (playwright) tests (good for ci). | | ||
| `yarn test:e2e:ui` | Run the e2e (playwright) tests with user interface. | | ||
| `yarn test` | Run all the kind of tests. | | ||
|
||
- additional helpful flags - https://playwright.dev/docs/test-cli | ||
|
||
## useful resources: | ||
|
||
- [the design file](https://www.figma.com/file/Plw8Uuu6U96CcX5tJyRMoW/Public-Transportation-visual-informaiton?type=design&node-id=0-1&mode=design&t=Dh8lI3EJ37unxvoe-0) | ||
- [data model schema](https://github.com/hasadna/open-bus-stride-db/blob/main/DATA_MODEL.md) | ||
- [API documentation and examples (swagger)](https://open-bus-stride-api.hasadna.org.il/docs) | ||
- [the deployed website](https://open-bus-map-search.hasadna.org.il/dashboard) | ||
|
||
## Troubleshooting | ||
|
||
we're here to help! feel free to join our [Slack channel](https://join.slack.com/t/hasadna/shared_invite/zt-21qipktl1-7yF4FYJVxAqXl0wE4DlMKQ) | ||
|
||
# Related Repositories | ||
|
||
- the API client | ||
- the data API | ||
|
||
## API client | ||
|
||
The client is a JS library that provides methods and data models. for example: | ||
https://github.com/hasadna/open-bus-map-search/blob/main/src/model/busStop.ts#L4 | ||
[link to repo](https://github.com/iliakap/open-bus-stride-client). | ||
|
||
## data API | ||
|
||
The API is backend code that provides us with data and aggregations from the DB | ||
You can see it's endpoints here: | ||
https://open-bus-stride-api.hasadna.org.il/docs | ||
[link to repo](https://github.com/hasadna/open-bus-stride-api). | ||
|
||
## FAQ | ||
|
||
### Why do I get a red `x` commit status? | ||
|
||
- lint - you have lint errors. fix them by running `yarn lint:fix` | ||
- tests - you have test errors. see them by running `yarn test:unit:ci` | ||
- build - you have build errors. see them by running `yarn build` | ||
- pr title validation - you have an invalid pr title. please edit the title of your PR with conventional commit formatting. examples: `feat: add new feature`, `fix: fix a bug` or `docs: update README.md` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.