wargabantuwarga.com icon indicating copy to clipboard operation
wargabantuwarga.com copied to clipboard

feat: use vaccination database data for `Tempat vaksin`

Open redhoyasa opened this issue 3 years ago β€’ 22 comments

Closes https://github.com/kawalcovid19/wargabantuwarga.com/issues/805

Description

Still a draft...

The approach taken will be similar to the one defined in https://github.com/kawalcovid19/wargabantuwarga.com/issues/805.

Current Tasks

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

redhoyasa avatar Oct 29 '21 06:10 redhoyasa

❌ Deploy Preview for wargabantuwarga failed.

πŸ”¨ Explore the source changes: 3f4674448a028fd8694a70df42bce006aa47244d

πŸ” Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/617bbc63a881010007c1c411

netlify[bot] avatar Oct 29 '21 06:10 netlify[bot]

Codecov Report

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

:exclamation: 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.

codecov[bot] avatar Oct 29 '21 06:10 codecov[bot]

Hi mas @zainfathoni, I believe https://github.com/kawalcovid19/wargabantuwarga.com/issues/804 is a prerequisite for this PR to be done. Do you know how to add the JSON data to the mirror?

redhoyasa avatar Oct 29 '21 09:10 redhoyasa

Hi mas @zainfathoni, any update?

redhoyasa avatar Nov 15 '21 02:11 redhoyasa

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 avatar Nov 27 '21 08:11 togetherwithasteria

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.

togetherwithasteria avatar Nov 27 '21 08:11 togetherwithasteria

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! πŸ™

zainfathoni avatar Dec 19 '21 15:12 zainfathoni

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.

togetherwithasteria avatar Dec 21 '21 13:12 togetherwithasteria

@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 avatar Jan 07 '22 04:01 redhoyasa

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

redhoyasa avatar Jan 07 '22 04:01 redhoyasa

@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". πŸ˜…

zainfathoni avatar Jan 07 '22 05:01 zainfathoni

@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.).

redhoyasa avatar Jan 07 '22 15:01 redhoyasa

@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. πŸ™

zainfathoni avatar Jan 07 '22 16:01 zainfathoni

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 avatar Jan 08 '22 00:01 togetherwithasteria

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

togetherwithasteria avatar Jan 08 '22 00:01 togetherwithasteria

Hello πŸ‘‹ I will check it today.

adityapurwa avatar Jan 08 '22 01:01 adityapurwa

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.

adityapurwa avatar Jan 08 '22 03:01 adityapurwa

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. πŸ™

zainfathoni avatar Jan 08 '22 03:01 zainfathoni

Thanks mas @adityapurwa for the fix.

redhoyasa avatar Jan 16 '22 16:01 redhoyasa

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

redhoyasa avatar Jan 16 '22 17:01 redhoyasa

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 avatar Jan 18 '22 10:01 togetherwithasteria

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?

togetherwithasteria avatar Jan 18 '22 10:01 togetherwithasteria