Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to upload and delete mock data for DORA dashboard #49

Merged
merged 12 commits into from Mar 8, 2022

Conversation

chalenge
Copy link
Contributor

@chalenge chalenge commented Mar 3, 2022

Add scripts to upload and delete mock data for DORA dashboard.

Ensure you are running the latest version of Faros CE.

From root directory

docker-compose stop; ./start.sh

Then get into the mock-data directory and install dependencies

cd mock-data && npm i

Usage

Upload data

./bin/mock-data upload

Deleting data uploaded by script

./bin/mock-data delete

Use -u flag to specify Hasura service url if using a different endpoint

ypc-faros and others added 3 commits February 28, 2022 11:17
* Creates endpoints for Hasura mutations in resources

* Run promises to create endpoints in parallel

* Updates queries/endpoints only if needed

* Prettify graphql files

* Only adds query/endpoint if missing

* Fix ts formatting issues

Co-authored-by: Matthew Tovbin <tovbinm@users.noreply.github.com>
@@ -3,6 +3,7 @@ mutation insert_cicd_Artifact(
$data_artifact_id: String!
$data_artifact_organization: String!
$data_artifact_source: String!
$data_origin: String!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ypc-faros Does adding the origin as a mandatory field break the CLI scripts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be a breaking change for events CLI. Maybe just make optional?

@tovbinm
Copy link
Contributor

tovbinm commented Mar 3, 2022

Let's move the the code from init to mock?

@chalenge
Copy link
Contributor Author

chalenge commented Mar 4, 2022

Let's move the the code from init to mock?

Ummm, fine by me but as mock-data until have multiple "mocking" utilities. @cjwooo thoughts?

@tovbinm
Copy link
Contributor

tovbinm commented Mar 4, 2022

Sure, just not in init.

Signed-off-by: Chalenge Masekera <chalenge@faros.ai>
Copy link
Contributor

@thomas-gerber thomas-gerber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a linter, compiler option and packaging info in mock-data. Do we need them here as well given we probably have similar ones in init?

@tovbinm
Copy link
Contributor

tovbinm commented Mar 5, 2022

@thomas-gerber you typically have these defined separately per project

Copy link
Contributor

@ypc-faros ypc-faros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you make the endpoint file names all lowercase? (e.g., delete_cicd_Organization.gql => delete_cicd_organization.gql)

mock-data/src/hasura.ts Outdated Show resolved Hide resolved
mock-data/src/hasura.ts Outdated Show resolved Hide resolved
Signed-off-by: Chalenge Masekera <chalenge@faros.ai>
@chalenge chalenge requested a review from ypc-faros March 8, 2022 06:30

import {MockData} from './mockdata';

const USAGE = 'Usage: node index.js <upload> | <delete> <hasura url> ';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: | => <upload | delete>

@chalenge chalenge merged commit 405bb27 into main Mar 8, 2022
@chalenge chalenge deleted the cm/mock-data branch March 8, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants