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

Fake API refactoring #304

Open
sashasushko opened this issue Mar 18, 2019 · 17 comments
Open

Fake API refactoring #304

sashasushko opened this issue Mar 18, 2019 · 17 comments

Comments

@sashasushko
Copy link
Contributor

sashasushko commented Mar 18, 2019

For easy development we use fake API server (look fakeapi folder). But we keep all data in one big db.json file. It's not comfortable. json-server tool allow generate data on the go by JavaScript (look Generate random data).

ToDo

  • not break backward compatibility
  • write code, that will generate data on the json-server start. Structure of response must be based on types from Domain folder, not on data from db.json file. Data in file could be obsolete
  • remove db.json
  • be prepared to resolve conflicts because there are several WIP issues that affect the fake API

Warn!
We don't have any tests yet, so to check that the backward compatibility is not broken, you will have to check everything by your hands. If you find it easier, you can instead write unit tests for MoiraApi.js. There is Jest in project. Installed and configured.


Please, look at two our major rules for contributors.

@sashasushko sashasushko changed the title Рефакторинг поддельного АПИ Fake API refactoring Mar 18, 2019
@sashasushko sashasushko added this to Available in Google Summer of Code Introductory Tasks via automation Mar 18, 2019
@Vivekrajput20
Copy link

I want to work on it.

@sashasushko
Copy link
Contributor Author

@Vivekrajput20 please give chance to others :-) But if someone will not take it in few days, of course, you can

@shiv6146
Copy link

@sashasushko Can I take this up?

@sashasushko
Copy link
Contributor Author

@shiv6146 yep, you can try ;-)

@sashasushko sashasushko moved this from Available to Taken in Google Summer of Code Introductory Tasks Mar 20, 2019
@sashasushko
Copy link
Contributor Author

@shiv6146 how you'r going?

@alekhyaNynala
Copy link

@sashasushko May I take up this task? I think it has already been many days.
I am very much interested to work on it

@alekhyaNynala
Copy link

I want even take up the related issues i.e #287 and #286

@alekhyaNynala
Copy link

Thank you

@sashasushko
Copy link
Contributor Author

@alekhyaNynala Hi.
Let's do one by one. Start with this #304

@alekhyaNynala
Copy link

@sashasushko Ok I'll work on this one.
Thank you.

@sashasushko
Copy link
Contributor Author

@alekhyaNynala thank you, not me :-)

@beevee beevee moved this from Taken to Available in Google Summer of Code Introductory Tasks Jan 9, 2020
@hv7214
Copy link

hv7214 commented Feb 22, 2020

@sashasushko just want some clarifications before i start working on this issue. Can values be any random string or it should have some optimal substructure ? Like trigger/targets can be any value or something like this aliasByNode(Egais.Api.Front.Controllers.Time.*.*.*.*.p95,5, 7, 8).

@kunaltawatia
Copy link

kunaltawatia commented Mar 1, 2020

@sashasushko just want some clarifications before i start working on this issue. Can values be any random string or it should have some optimal substructure ? Like trigger/targets can be any value or something like this aliasByNode(Egais.Api.Front.Controllers.Time.*.*.*.*.p95,5, 7, 8).

Hi @hv7214,
I guess all values, which are to be randomised, belong to any type described in Domain folder, where their own types are mentioned.
For example Trigger/targets have a type of Array<string> mentioned in Domain/Trigger.js file. So it might have an array of random strings.
But still some conflicts might come for example config.contacts.validation expects a regex with type string.

@kunaltawatia
Copy link

@sashasushko I think I could do this enhancement. Is this still available for assignment?

@hv7214
Copy link

hv7214 commented Mar 1, 2020

@sashasushko just want some clarifications before i start working on this issue. Can values be any random string or it should have some optimal substructure ? Like trigger/targets can be any value or something like this aliasByNode(Egais.Api.Front.Controllers.Time.*.*.*.*.p95,5, 7, 8).

Hi @hv7214,
I guess all values, which are to be randomised, belong to any type described in Domain folder, where their own types are mentioned.
For example Trigger/targets have a type of Array<string> mentioned in Domain/Trigger.js file. So it might have an array of random strings.

@kunaltawatia i know that it has to be string, that's why asked for clarification regarding the structure. Any random string doesn't make much sense. I think you should have a look in db.json.

@kunaltawatia
Copy link

@kunaltawatia i know that it has to be string, that's why asked for clarification regarding the structure. Any random string doesn't make much sense. I think you should have a look in db.json.

Oh I might have got your question wrong.

@sashasushko
Copy link
Contributor Author

@kunaltawatia is right. The type must be correct. It's "first of all". But @hv7214 your opinion about consistency of mock data also is correct.

I'm not familiar with target syntax, you can dig itself (there is some page in documentation) or ask backend developers. For example, @beevee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants