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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
UX: Show if MaxMind key is missing on IP lookup #18993
Conversation
app/assets/javascripts/admin/addon/templates/components/ip-lookup.hbs
Outdated
Show resolved
Hide resolved
app/assets/javascripts/admin/addon/templates/components/ip-lookup.hbs
Outdated
Show resolved
Hide resolved
This pull request has been mentioned on Discourse Meta. There might be relevant details there: https://meta.discourse.org/t/maxminddb-not-found-error/148512/9 |
62609de
to
3a37860
Compare
app/assets/javascripts/admin/addon/templates/components/ip-lookup.hbs
Outdated
Show resolved
Hide resolved
Conflicts resolved. |
I applied the changes to our running container. After a restart, the change to |
@MichaIng the changes look fine but could you check out the test failures please? |
I guess the GeoIP results are mocked. The license key needs to be defined, at least with a dummy value. I'll have a look. EDIT: Okay, a hardcoded database is used for the test. I added a dummy license key. I hope defining a |
Okay defining a dummy value just like that does not work:
So Of course we could define Another approach would be to use a valid MaxMind license key via GitHub Actions secret. |
Okay, I did now assume that If this does not work, then I need help from someone with more code insights and/or Ruby knowledge to have
EDIT2: Finally I was able to fix it: https://github.com/MichaIng/discourse/actions/runs/4855957283/jobs/8655294879 |
e3fb073
to
33ad201
Compare
Let's hold off on merging till we improve global setting mocking in the specs. Its a tiny change but I don't want to carry this legacy, its a bit confusing. |
c329907
to
2ba58b8
Compare
as discussed in https://meta.discourse.org/t/maxminddb-not-found-error/148512/7. Signed-off-by: MichaIng <micha@dietpi.com>
Do you mean the currently used method with "legacy" and confusing? To me this looks quite clean: global_setting "maxmind_license_key", "dummy" Or what would you improve for mocking/changing global settings in tests? |
sorry for the delay here, looking good, tests are not passing though cause this needs a rebase... I hate to delay you even more on this change... will take the risk here and merge it and followup if needed. Thanks @MichaIng |
This improves the implementation of #18993 1. Error message displayed to user is clearer 2. open_db will also be called, even if license key is blank, as it was previously 3. This in turn means no need to keep stubbing 'maxmind_license_key'
This improves the implementation of #18993 1. Error message displayed to user is clearer 2. open_db will also be called, even if license key is blank, as it was previously 3. This in turn means no need to keep stubbing 'maxmind_license_key'
This reverts commit c58a41c.
This reverts commit c58a41c.
as discussed in https://meta.discourse.org/t/maxminddb-not-found-error/148512/7.
This also aims to mute the related error messages in logs, when Discourse tries to open the two non-existent MaxMind database files.
I just read the note about the tests. I'm completely new to Ruby and qunit, so would have to look into it. This is currently completely untested since I need to find out first how to apply best to a running Discourse instance 馃槈.