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
DEV: Ability to collect stats without exposing them via API #23933
Merged
AndrewPrigorshnev
merged 5 commits into
main
from
dev/ability-to-collect-stats-without-public-exposing
Nov 9, 2023
Merged
DEV: Ability to collect stats without exposing them via API #23933
AndrewPrigorshnev
merged 5 commits into
main
from
dev/ability-to-collect-stats-without-public-exposing
Nov 9, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
7 times, most recently
from
October 19, 2023 15:02
95d6f80
to
813039c
Compare
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
3 times, most recently
from
October 24, 2023 21:45
9dbac3b
to
bf3f119
Compare
AndrewPrigorshnev
changed the title
DEV: Ability to collect stats without exposing them
DEV: Ability to collect stats without exposing them via API
Oct 24, 2023
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
from
October 24, 2023 22:22
7f0edf2
to
44d2ddf
Compare
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
2 times, most recently
from
October 26, 2023 13:51
d2ee31f
to
721b38c
Compare
jjaffeux
reviewed
Oct 27, 2023
jjaffeux
reviewed
Oct 29, 2023
jjaffeux
reviewed
Oct 29, 2023
jjaffeux
reviewed
Oct 29, 2023
jjaffeux
reviewed
Oct 29, 2023
jjaffeux
reviewed
Oct 29, 2023
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
2 times, most recently
from
October 31, 2023 23:09
3b58457
to
5757d51
Compare
jjaffeux
approved these changes
Nov 1, 2023
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
2 times, most recently
from
November 1, 2023 18:34
c389b33
to
501753e
Compare
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
from
November 7, 2023 17:48
501753e
to
864c3c2
Compare
heymarkreeves
approved these changes
Nov 8, 2023
AndrewPrigorshnev
force-pushed
the
dev/ability-to-collect-stats-without-public-exposing
branch
from
November 9, 2023 17:05
864c3c2
to
5fe393d
Compare
AndrewPrigorshnev
deleted the
dev/ability-to-collect-stats-without-public-exposing
branch
November 9, 2023 20:44
This pull request has been mentioned on Discourse Meta. There might be relevant details there: https://meta.discourse.org/t/shields-io-unable-to-retrieve-discourse-statistics-api/128574/12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the ability to collect stats without exposing them among other stats via API.
The most important thing I wanted to achieve is to provide an API where stats are not exposed by default, and a developer has to explicitly specify that they should be exposed (
expose_via_api: true
). Implementing an opposite solution would be simpler, but that's less safe in terms of potential security issues.When working on this, I had to refactor the current solution. I would go even further with the refactoring, but the next steps seem to be going too far in changing the solution we have, and that would also take more time. Two things that can be improved in the future:
discourse/app/views/about/index.html.erb
Lines 61 to 101 in 63a0700
The most significant refactorings are:
Stat
model