FIX: Skip notifications about beginner badges (PR #12819)

The problem from this closed PR solved in a more simple way.

Now we’re just suppressing notifications about beginner badges, but still granting them. No need to change something on the DB level anymore.

GitHub

I could not make this class method private, unfortunately because we call it from an instance method grant.

This might bites us in the future if/when we add a new badge in the GettingStarted group.

I think being explicit would be the best way. Something like

BEGINNER_BADGE_IDS ||= [
  Welcome,
  Reader,
  Autobiographer,
  Editor,
  WikiEditor,
  FirstLike,
  # ...
]

def for_beginners?
  BEGINNER_BADGE_IDS.include?(id)
end

Yeah, it’s a good point, but there exists another consideration. Some badges are from plugins. For example First Reaction, Licensed and Certifed. I think we cannot add these to the list in Core.

If we suppress all the Getting Started badges these badges from plugins would be suppressed automatically.

This might bites us in the future if/when we add a new badge in the GettingStarted group.

This is how it was intended to work at the very beginning - we wanted to suppress all the Getting Started badges.

What if leave it like this by now. In the future, we always can switch to an explicit list or even to a new field in the database table how it was implemented in previous closed PR.

This PR only adds one new badge to list - Welcome. The rest of the logic still working as before.

We can add an API for plugins to add new beginner badges, but sure, we can start with this.

This pull request has been mentioned on Discourse Meta. There might be relevant details there: