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: add nusa:stat command for local development uses #84

Merged
merged 7 commits into from
Jul 31, 2024
Merged

Conversation

feryardiant
Copy link
Contributor

This command mainly use while in development, to print the current stat of the whole data.

composer testbench nusa:stat

+------+----------------------------+-----------+-----------+----------+
| Code | Name                       | Regencies | Districts | Villages |
+------+----------------------------+-----------+-----------+----------+
| 11   | Aceh                       | 23        | 290       | 6500     |
| 12   | Sumatera Utara             | 33        | 455       | 6110     |
| 13   | Sumatera Barat             | 19        | 179       | 1265     |
| 14   | Riau                       | 12        | 172       | 1862     |
| 15   | Jambi                      | 11        | 144       | 1585     |
| 16   | Sumatera Selatan           | 17        | 241       | 3258     |
| 17   | Bengkulu                   | 10        | 129       | 1513     |
| 18   | Lampung                    | 15        | 229       | 2651     |
| 19   | Kepulauan Bangka Belitung  | 7         | 47        | 393      |
| 21   | Kepulauan Riau             | 7         | 80        | 418      |
| 31   | Dki Jakarta                | 6         | 44        | 267      |
| 32   | Jawa Barat                 | 27        | 627       | 5957     |
| 33   | Jawa Tengah                | 35        | 576       | 8563     |
| 34   | Daerah Istimewa Yogyakarta | 5         | 78        | 438      |
| 35   | Jawa Timur                 | 38        | 666       | 8494     |
| 36   | Banten                     | 8         | 155       | 1552     |
| 51   | Bali                       | 9         | 57        | 716      |
| 52   | Nusa Tenggara Barat        | 10        | 117       | 1166     |
| 53   | Nusa Tenggara Timur        | 22        | 315       | 3442     |
| 61   | Kalimantan Barat           | 14        | 174       | 2145     |
| 62   | Kalimantan Tengah          | 14        | 136       | 1571     |
| 63   | Kalimantan Selatan         | 13        | 156       | 2016     |
| 64   | Kalimantan Timur           | 10        | 105       | 1038     |
| 65   | Kalimantan Utara           | 5         | 55        | 482      |
| 71   | Sulawesi Utara             | 15        | 171       | 1839     |
| 72   | Sulawesi Tengah            | 13        | 175       | 2017     |
| 73   | Sulawesi Selatan           | 24        | 313       | 3058     |
| 74   | Sulawesi Tenggara          | 17        | 221       | 2287     |
| 75   | Gorontalo                  | 6         | 77        | 729      |
| 76   | Sulawesi Barat             | 6         | 69        | 648      |
| 81   | Maluku                     | 11        | 118       | 1235     |
| 82   | Maluku Utara               | 10        | 118       | 1185     |
| 91   | Papua                      | 9         | 105       | 999      |
| 92   | Papua Barat                | 13        | 218       | 1837     |
| 93   | Papua Selatan              | 4         | 82        | 690      |
| 94   | Papua Tengah               | 8         | 131       | 1208     |
| 95   | Papua Pegunungan           | 8         | 252       | 2627     |
+------+----------------------------+-----------+-----------+----------+

The command will give you the current number of regencies, districts and villages on each province. Optionally you can pass --diff option whether any changes in the main database after tests ran. The --diff option should look like these.

composer testbench nusa:stat -- --diff

Changes
+------+----------------------------+-----------+-----------+----------+
| Code | Name                       | Regencies | Districts | Villages |
+------+----------------------------+-----------+-----------+----------+
| 81   | Maluku                     | 11        | 119       | 1245     |
| 82   | Maluku Utara               | 10        | 129       | 1195     |
+------+----------------------------+-----------+-----------+----------+

The main goals is to provide summary and reports whether there's a changes on the main nusa' database in every pull request or not. Even better if we could enable auto comment on every changes made by a pull request.

Notable changes

  • There's indeed some changes in regencies from upstream
  • Show current province code on its attribute test
  • Add pint.json config to exclude submodules directory

Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
@feryardiant feryardiant self-assigned this Jul 31, 2024
@feryardiant feryardiant requested a review from a team July 31, 2024 03:08
@github-actions github-actions bot added db: schema Database related things, including model and migrations enhancement New feature or request labels Jul 31, 2024
@feryardiant
Copy link
Contributor Author

This is odd,

I was expecting the tests should be failed due to there's some issue in the upstream cahyadsn/wilayah#49 🤔

@feryardiant feryardiant merged commit 60eb2fb into main Jul 31, 2024
19 checks passed
@feryardiant feryardiant deleted the feat/stat branch July 31, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db: schema Database related things, including model and migrations enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant