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

feat: use vaccination database data for Tempat vaksin #817

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

redhoyasa
Copy link

@redhoyasa redhoyasa commented Oct 29, 2021

Closes #805

Description

Still a draft...

The approach taken will be similar to the one defined in #805.

Current Tasks

  • prevent undefined province error in vaccination DB fetcher
  • omit current vaccination data
  • append new vaccination data
  • extract the data merging to a helper function so it can be used by [contactSlug] page

@netlify
Copy link

netlify bot commented Oct 29, 2021

❌ Deploy Preview for wargabantuwarga failed.

🔨 Explore the source changes: 3f46744

🔍 Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/617bbc63a881010007c1c411

@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #817 (37b8362) into main (43d0ab3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 37b8362 differs from pull request most recent head 3f46744. Consider uploading reports for the commit 3f46744 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #817      +/-   ##
==========================================
+ Coverage   87.06%   87.08%   +0.01%     
==========================================
  Files         134      134              
  Lines        1438     1440       +2     
  Branches      455      455              
==========================================
+ Hits         1252     1254       +2     
  Misses        181      181              
  Partials        5        5              
Impacted Files Coverage Δ
etc/fetchers/fetch-vaccination-database.ts 100.00% <100.00%> (ø)
pages/provinces/[provinceSlug]/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43d0ab3...3f46744. Read the comment docs.

@redhoyasa
Copy link
Author

Hi mas @zainfathoni, I believe #804 is a prerequisite for this PR to be done. Do you know how to add the JSON data to the mirror?

@redhoyasa
Copy link
Author

Hi mas @zainfathoni, any update?

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Nov 27, 2021

Hi mas @zainfathoni, I believe #804 is a prerequisite for this PR to be done. Do you know how to add the JSON data to the mirror?

Heya! #804 is currently not a requirement for this. 93b1f76 unintentionally dropped the mirrors. Sorry, I forgot to revert Nefoplayground/wargabantuwarga.com@a7532dd as #806 was merged as the drop was intended for debugging purposes only.

@togetherwithasteria
Copy link
Contributor

Also, regarding the mirror, I think #783 might be a good resource to get your head around the things here? I forgot my understanding of it, but maybe you will understand it.

@@ -23,11 +23,12 @@ export async function fetchVaccinationDatabase() {
fetch(`${vaksinId}/locations/${province}`)
.then((res) => res.json() as unknown as VaccinationRegion)
.then((region) => {
locations[region.data[0].province] = region.data.map((location) => ({
locations[province] = region.data.map((location) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice heads up on that one.

@zainfathoni
Copy link
Member

Hi mas @zainfathoni, I believe #804 is a prerequisite for this PR to be done. Do you know how to add the JSON data to the mirror?

Heya! #804 is currently not a requirement for this. 93b1f76 unintentionally dropped the mirrors. Sorry, I forgot to revert Nefoplayground/wargabantuwarga.com@a7532dd as #806 was merged as the drop was intended for debugging purposes only.

Sorry for the slow response @redhoyasa. I have been swamped in my office due to a tight timeline for our current project lately.
@fortressia could you please submit another PR to revert your changes that dropped the mirror-box? Thanks! 🙏

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Dec 21, 2021

Hi mas @zainfathoni, I believe #804 is a prerequisite for this PR to be done. Do you know how to add the JSON data to the mirror?

Heya! #804 is currently not a requirement for this. 93b1f76 unintentionally dropped the mirrors. Sorry, I forgot to revert Nefoplayground/wargabantuwarga.com@a7532dd as #806 was merged as the drop was intended for debugging purposes only.

Sorry for the slow response @redhoyasa. I have been swamped in my office due to a tight timeline for our current project lately. @fortressia could you please submit another PR to revert your changes that dropped the mirror-box? Thanks! pray

Okay. Sorry for late reply though.

@redhoyasa
Copy link
Author

@fortressia I notice that you've reverted the mirror box. However, I don't see that the mirror-box calling fetchVaccinationDatabase.

Is this expected? cc: @zainfathoni

@redhoyasa
Copy link
Author

As booster shots will be available in coming weeks, I think WBW could be more relevant (again).

@zainfathoni
Copy link
Member

@fortressia I notice that you've reverted the mirror box. However, I don't see the mirror-box calling fetchVaccinationDatabase.

Is this expected? cc: @zainfathoni

Could you please elaborate on what you saw and expected, @redhoyasa?

The answer to your question can be yes and no simultaneously, depending on what you meant by "you don't see". 😅

@redhoyasa
Copy link
Author

@fortressia I notice that you've reverted the mirror box. However, I don't see the mirror-box calling fetchVaccinationDatabase.
Is this expected? cc: @zainfathoni

Could you please elaborate on what you saw and expected, @redhoyasa?

The answer to your question can be yes and no simultaneously, depending on what you meant by "you don't see". 😅

From my understanding, we use mirror-box to speed up the CI/build time. It works by directly download the transformed data instead of downloading the raw data and transform it during the build time.

However, it requires the transformed data to be available in https://wbw-box.lucentshard.com, doesn't it?

My concern is that I couldn't manage to find the transformed Tempat vaksin data from Kemenkes in that mirror source. I am expecting that the data would be available in the mirror and we can just download it like we do for other data (faq sheets, database, etc.).

@zainfathoni
Copy link
Member

@fortressia I notice that you've reverted the mirror box. However, I don't see the mirror-box calling fetchVaccinationDatabase.
Is this expected? cc: @zainfathoni

Could you please elaborate on what you saw and expected, @redhoyasa?
The answer to your question can be yes and no simultaneously, depending on what you meant by "you don't see". 😅

From my understanding, we use mirror-box to speed up the CI/build time. It works by directly download the transformed data instead of downloading the raw data and transform it during the build time.

However, it requires the transformed data to be available in https://wbw-box.lucentshard.com, doesn't it?

My concern is that I couldn't manage to find the transformed Tempat vaksin data from Kemenkes in that mirror source. I am expecting that the data would be available in the mirror and we can just download it like we do for other data (faq sheets, database, etc.).

I see. Thank you for elaborating on it. There might be a mistake somewhere along the way. The mirror-box automation is supposed to call the fetch-wbw script and then store the static JSON files in the server. Mas @adityapurwa, could you please take another look at why it's not happening as expected? Thanks. 🙏

@togetherwithasteria
Copy link
Contributor

I see. Thank you for elaborating on it. There might be a mistake somewhere along the way. The mirror-box automation is supposed to call the fetch-wbw script and then store the static JSON files in the server. Mas @adityapurwa, could you please take another look at why it's not happening as expected? Thanks. 🙏

Ah, I see. I actually wanted to send the revert PR earlier, but that made me confused so much that I sent the PR just after you told me to.

@togetherwithasteria
Copy link
Contributor

togetherwithasteria commented Jan 8, 2022

Also, I didn't think mirror-box.ts sent any files to the server. It's not implemented there.

@adityapurwa
Copy link
Collaborator

Hello 👋 I will check it today.

@adityapurwa
Copy link
Collaborator

So I've found the culprit, the server is running out of memory :)

I've added an additional 1.5GB of memory, just tested running it and it's running without issues.

@zainfathoni
Copy link
Member

So I've found the culprit, the server is running out of memory :)

I've added an additional 1.5GB of memory, just tested running it and it's running without issues.

LOL 🤣
Thanks for taking the time to investigate and fix it, Mas @adityapurwa. 🙏

@redhoyasa
Copy link
Author

Thanks mas @adityapurwa for the fix.

@redhoyasa
Copy link
Author

However, I cannot find wbw-vaccination-database.json in https://wbw-box.lucentshard.com/.

Probably we have to change region.data[0].province to province in this line cc: @fortressia

@togetherwithasteria
Copy link
Contributor

However, I cannot find wbw-vaccination-database.json in https://wbw-box.lucentshard.com/.

Probably we have to change region.data[0].province to province in this line cc: @fortressia

Emm, I think that's just an unrelated refactor to the file being missing in the server, right?

@togetherwithasteria
Copy link
Contributor

Or did you find that code made the file undetected, which is kinda illogical in my opinion?

If that's the case, can you please elaborate more?

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.

Use the wbw-vaccination-database.json data to replace all Tempat vaksin data from wbw-database.json
4 participants