Commit Graph

55960 Commits

Author SHA1 Message Date
dependabot[bot]
c33d75c2d5
Build(deps-dev): Bump @swc/core from 1.7.24 to 1.7.26 (#28845)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.7.24 to 1.7.26.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.7.24...v1.7.26)

---
updated-dependencies:
- dependency-name: "@swc/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-11 12:52:00 +02:00
Jarek Radosz
83acd8b80a
DEV: Change qunit_parallel to 2 for frontend themes (#28842)
This seems to mitigate the flaky timeouts we've been seeing recently, while not affecting the speed in any meaningful way.
2024-09-11 11:39:26 +02:00
Jarek Radosz
e87d0addf7
DEV: Run theme tests in random order (#28841)
that is: randomize the order in which theme test suites are scheduled
2024-09-11 10:45:12 +02:00
Bianca Nenciu
38592dc48e
PERF: Preload user options when status is enabled (#28827)
The user option 'hide_profile_and_presence' is necessary to figure out
if the user status has to be displayed or not. In order to avoid N+1s
generated by `include_status?` method, both `user_status` and
`user_option` relations have to be included.
2024-09-11 10:39:14 +03:00
Bianca Nenciu
d63ffe22f4
DEV: Track SQL queries from MiniSql (#28824)
`track_sql_queries` only returned queries that were executed by
ActiveRecord. All queries executed through DB.exec, DB.query and others
were not returned.
2024-09-11 10:14:53 +03:00
Krzysztof Kotlarek
1f1709d249
FIX: use a custom prefix for custom flags (#28839)
Currently, when the custom flag has the same name as the system flag (which is disabled) then it is not displayed. To fix the problem, `custom_` prefix as `name_key` is used to distinguish between the system and the custom flag.

I considered writing a migration to fix existing custom flags name key. However, at the end of migration I would need to run rails code to reset cache `Flag.reset_flag_settings!`. I decided to skip that step as it is a very edge case. If someone has the same flag name as the system flag, then all they have to do is edit the flag and click save.

In addition, I made 2 small fixes:
- edit flag title was missing translation;
- flag form UI was not showing that description is the required field.
2024-09-11 15:30:20 +10:00
Martin Brennan
0323b366f3
DEV: Fix report flakys (#28838)
The Report model spec was directly adding methods
to the Report class, which was causing errors in the
admin reports controller because it would look for
a translation of the report name (e.g. report_timeout_test)
like so `I18n.t("reports.#{type}.title")`, then get an
error because the translation did not exist.

This is fixed by using `Report.stubs` instead, which is
cleaned up after every test.
2024-09-11 15:24:19 +10:00
Martin Brennan
894f146b3a
DEV: Add component tests for admin page header components (#28837)
These components will be used in many places and are quite
independent, adding component tests is sensible.
2024-09-11 13:27:58 +10:00
Alan Guo Xiang Tan
279ffb3351
DEV: JOBS should be cap at 2 in assets:precompile:build (#28834)
This fixes a mistake I introduced in
b652f66378. I wanted to cap it at 2 not 4.
2024-09-11 08:18:42 +08:00
dependabot[bot]
9b465e1914
Build(deps-dev): Bump sinon from 18.0.0 to 18.0.1 (#28833)
Bumps [sinon](https://github.com/sinonjs/sinon) from 18.0.0 to 18.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v18.0.0...v18.0.1)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-11 02:04:21 +02:00
dependabot[bot]
be682767d1
Build(deps-dev): Bump express from 4.19.2 to 4.20.0 (#28832)
Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.20.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-11 02:02:58 +02:00
Alan Guo Xiang Tan
b652f66378
DEV: Cap number of thread-loader workers in assets:precompile:build (#28830)
We were running into errors running `ember build` on machines with high
CPU counts. It was then noted that `thread-loader`, which embroider uses, defaults to spinning
up x workers where x is number of physical CPU cores - 1. That is
probably too much so we set out to find out an optimial count to set for
the `JOBS` env which embroider will use to set the number of
`thread-loader` workers.

I first built an image using the following Dockerfile.

```
FROM discourse/base:release

RUN cd /var/www/discourse && sudo -EH -u discourse bundle exec rake plugin:install_all_official
RUN cd /var/www/discourse && sudo -EH -u discourse bundle exec rake assets:precompile:prereqs
```

I then ran the following command on my M3 Max Macbook Pro that has 14
phyisal CPU cores.

```
for j in 1 2 4 8 14; do echo "JOBS=$j"; time docker run --rm -it -e JOBS=$j test:latest /bin/bash -c "su discourse -c 'cd /var/www/discourse && bundle exec rake assets:precompile:build'"; done
```

These are the results I got:

```
JOBS=1 0.04s user 0.03s system 0% cpu 1:01.92 total
JOBS=2 0.04s user 0.02s system 0% cpu 42.605 total
JOBS=4 0.04s user 0.02s system 0% cpu 37.012 total
JOBS=8 0.04s user 0.02s system 0% cpu 35.199 total
JOBs=14 0.04s user 0.02s system 0% cpu 37.941 total
```

We think JOBS=2 is a good default when the `JOBS` env has not been set.
Anything above just consumes more resources for little benefit.
2024-09-11 07:58:36 +08:00
Osama Sayegh
d760403bfd
DEV: Fix the build on github (#28831) 2024-09-11 07:52:23 +08:00
Osama Sayegh
91ba2a4aab
DEV: Add debug logging for automation recurring trigger (#28829)
We're seeing a problem where some recurring automations end up in a state where they don't have any `pending_automations` records scheduled which effectively makes the recurring automation dead. We need to add some debugging to figure out what might be causing this problem.

Internal topic: t/138045.
2024-09-11 01:29:15 +03:00
Jarek Radosz
917621ed80
FIX: Errors may be null-ish (#28826) 2024-09-10 20:42:02 +02:00
Ella E.
995931b6ec
UX: Update banner to handle responsive images with aspect ratio scaling (#28825) 2024-09-10 12:19:40 -06:00
Penar Musaraj
1a88728d39
FIX: Poll voters list wasn't expanding properly (#28823) 2024-09-10 11:46:12 -04:00
Bianca Nenciu
9b0300a647
PERF: Preload voters_count and has_voted (#28808)
These fields are often used when serializing topics which may contain
multiple polls. On average, serializing a poll took 2+N queries where N
is the number of options. This change reduces the number of queries to
3, one for each field (Poll#voters_count, PollOption#voters_count and
Poll#has_voted?).
2024-09-10 18:41:08 +03:00
Keegan George
f2059bf15f
FIX: Form template limit validation (#28791) 2024-09-10 08:11:44 -07:00
Osama Sayegh
0a994a9221
FEATURE: Add setting to exclude groups from /about page (#28809)
This commit adds a new `about_page_hidden_groups` setting to exclude members of specific groups from the admin and moderator lists on the /about page.

Internal topic: t/137717.
2024-09-10 14:43:41 +03:00
Robert
88e1690d86
FIX: poll preview list styling remove redundant bullets (#28592) 2024-09-10 10:54:59 +02:00
Jarek Radosz
086169c1cb
DEV: Update test-prof from 1.4.1 to 1.4.2 (#28819)
The update introduced a small regression in d-data-explorer that was handled in https://github.com/discourse/discourse-data-explorer/pull/326
2024-09-10 10:44:18 +02:00
David Battersby
c697e70892
FIX: prevent chat channel not found ajax error (#28818)
On occasion we get an error popup on desktop due to the channel not being found.

This change means that we only check the cached channels in ChatChannelsManager for the matching channel id, but we skip doing manual lookup which results in ajax popup when it fails.
2024-09-10 11:52:25 +04:00
dependabot[bot]
f86e6b8d63
Build(deps-dev): Bump typescript from 5.5.4 to 5.6.2 (#28814)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.4 to 5.6.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.5.4...v5.6.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 09:47:00 +02:00
dependabot[bot]
e34aca0368
Build(deps): Bump a11y-dialog from 8.1.0 to 8.1.1 (#28813)
Bumps [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) from 8.1.0 to 8.1.1.
- [Release notes](https://github.com/KittyGiraudel/a11y-dialog/releases)
- [Commits](https://github.com/KittyGiraudel/a11y-dialog/compare/8.1.0...8.1.1)

---
updated-dependencies:
- dependency-name: a11y-dialog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 09:46:38 +02:00
dependabot[bot]
468eb009fb
Build(deps): Bump babel-plugin-ember-template-compilation (#28812)
Bumps [babel-plugin-ember-template-compilation](https://github.com/emberjs/babel-plugin-ember-template-compilation) from 2.2.5 to 2.3.0.
- [Release notes](https://github.com/emberjs/babel-plugin-ember-template-compilation/releases)
- [Changelog](https://github.com/emberjs/babel-plugin-ember-template-compilation/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emberjs/babel-plugin-ember-template-compilation/commits)

---
updated-dependencies:
- dependency-name: babel-plugin-ember-template-compilation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 09:45:56 +02:00
moin-Jana
cd7aa53521
FIX: add "in:first" to user summary category search (#28688)
* FIX: add "in:first" to user summary category search

The "in:first" parameter was added to the search parameters for the topic count in the user summary category search.

This ensures that the search results focus specifically on the first posts in each topic, so only topics are returned.
Meta topic: https://meta.discourse.org/t/summary-page-by-category-topic-links/215848

* add tests

Provided by @natsw
2024-09-10 15:55:32 +10:00
chapoi
0332be0b34
UX: prevent a focus-visible outline on mobile (#28815) 2024-09-10 07:19:22 +02:00
Martin Brennan
61c1d35f17
FEATURE: Convert chat plugin UI to new show plugin and admin UI guidelines (#28632)
This commit converts the current chat plugin UI into the
new "show plugin" UI already followed by AI and Gamification.

In the process, I also:

* Made a dedicated /new route to create new webhooks
* Converted the webhook form to FormKit
* Made some fixes and improvements to the `AdminPluginConfigPage`, `AdminPageHeader`,
   and `AdminPageSubheader` generic components, so more plugins can
   adopt the UI guidelines too. This includes adding a header outlet so plugins
   can add action buttons to the plugin show page header.
* Fixes the submit button loading state for FormKit (by Joffrey)

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-09-10 15:16:16 +10:00
Martin Brennan
56877e9acf
UX: Hide 'other' and 'crawler' site traffic on report page (#28817)
Followup 14b436923c

On the standalone Site Traffic report page, we also need
to hide the 'other' and 'crawler' pageviews by default
like we do on the admin dashboard.
2024-09-10 14:31:51 +10:00
Martin Brennan
428fb793b7
UX: Add learn more URL for admin flags page (#28816)
Docs are published now at https://meta.discourse.org/t/moderation-flags/325589
2024-09-10 13:48:43 +10:00
Ella E.
19ba7c944b
UX: Add a description on the about config area (#28790)
* UX: Add a description on the about config area

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-09-09 20:31:13 -06:00
Martin Brennan
14b436923c
FEATURE: Switch to new methods of pageview measurement and reporting (#28729)
### UI changes

All of the UI changes described are gated behind the `use_legacy_pageviews`
site setting.

This commit changes the admin dashboard pageviews report to
use the "Consolidated Pageviews with Browser Detection" report
introduced in 2f2da72747 with
the following changes:

* The report name is changed to "Site traffic"
* The pageview count on the dashboard is counting only using the new method
* The old "Consolidated Pageviews" report is renamed as "Consolidated Legacy Pageviews"
* By default "known crawlers" and "other" sources of pageviews are hidden on the report

When `use_legacy_pageviews` is `true`, we do not show or allow running
the "Site traffic" report for admins. When `use_legacy_pageviews` is `false`,
we do not show or allow running the following legacy reports:

* consolidated_page_views
* consolidated_page_views_browser_detection
* page_view_anon_reqs
* page_view_logged_in_reqs

### Historical data changes

Also part of this change is that, since we introduced our new "Consolidated
Pageviews with Browser Detection" report, some admins are confused at either:

* The lack of data before a certain date , which didn’t exist before
  we started collecting it
* Comparing this and the current "Consolidated Pageviews" report data,
  which rolls up "Other Pageviews" into "Anonymous Browser" and so it
  appears inaccurate

All pageview data in the new report before the date where the _first_
anon or logged in browser pageview was recorded is now hidden.
2024-09-10 09:51:49 +10:00
Guhyoun Nam
aacd354de5
FEATURE: Added Category Experts unapproved post WebHook Event (#28802)
This PR is adding a Category Experts unapproved WebHook event type.
2024-09-10 07:56:35 +09:00
Ella E.
a7db66e8ab
FIX: Prevent layout shift caused by locale description length (#28807)
* FIX: Prevent layout shift caused by locale description length

* Fix linting error

* Apply prettier
2024-09-09 15:33:43 -06:00
Mark VanLandingham
e4457ed2c6
FIX: Remove breaking super call in scroll-tracker component (#28810) 2024-09-09 15:30:17 -05:00
David Taylor
9a36286920
FIX: Open file handles 'just in time' during s3 migration (#28806)
Previously we were opening the file handles, then putting them in a queue for upload. If that queue grows too large, we can hit a maximum open files limit.

This commit opens the file handle 'just in time', so the maximum number of open handles is equal to the upload concurrency (20).
2024-09-09 18:39:26 +01:00
dependabot[bot]
78e3436056
Build(deps): Bump terser from 5.31.6 to 5.32.0 (#28805)
Bumps [terser](https://github.com/terser/terser) from 5.31.6 to 5.32.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.31.6...v5.32.0)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 17:32:47 +02:00
Gerhard Schlager
7c3a29c9d6
DEV: Add converter framework for migrations-tooling (#28540)
* Updates GitHub Actions
* Switches from `bundler/inline` to an optional group in the `Gemfile` because the previous solution didn't work well with rspec
* Adds the converter framework and tests
* Allows loading private converters (see README)
* Switches from multiple CLI tools to a single CLI
* Makes DB connections reusable and adds a new abstraction for the `IntermediateDB`
* `IntermediateDB` acts as an interface for IPC calls when a converter steps runs in parallel (forks). Only the main process writes to the DB.
* Includes a simple example implementation of a converter for now.
2024-09-09 17:14:39 +02:00
Kris
d6eb0f4d96
FIX: replace shield-blank with shield-halved for font awesome (#28804) 2024-09-09 10:48:09 -04:00
Jordan Vidrine
9ed9032150
FIX: Requested changes from dev (#28784)
* FIX: Requested changes from dev

* FIX: Add base-url to other links

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-09-09 08:55:42 -05:00
David Taylor
7d8974d02f
UX: Upgrade to fontawesome 6.6.0 (#28778)
This upgrade is designed to be fully backwards-compatible. Any icon names which have changed will be automatically remapped to the new name. For now, this will happen silently. In future, once core & official themes/plugins have been updated, we will start raising deprecation errors to help theme/plugin authors update their code.

Extracted from https://github.com/discourse/discourse/pull/28715

Announcement at https://meta.discourse.org/t/were-upgrading-our-icons-to-font-awesome-6/325349

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2024-09-09 14:40:56 +01:00
Sam
70e27b3476
Revert "DEV: update mini_racer to latest (#28796)" (#28803)
This reverts commit c2b49bd095.
Still segfaulting
2024-09-09 18:41:12 +10:00
Guhyoun Nam
5102f964ce
DEV: Changed text for approved post webhook event (#28745)
This PR is for changing text for the approved post webhook event.
2024-09-09 12:06:02 +09:00
Linca
aab2987438
FEATURE: Log tag group changes in staff action log (#28787)
* FEATURE: Log tag group changes in staff action log

This commit records every change (add, change, delete) to a tag group in
the staff action log.

It uses a modal that was originally called ThemeChangeModal to display
changes, allowing staffs to see the specific changes clearly. The modal
is renamed to StaffActionLogChangeModal in this PR.

ref: https://meta.discourse.org/t/-/325011/14

Co-authored-by: Keegan George <kgeorge13@gmail.com>
2024-09-09 10:50:48 +08:00
Krzysztof Kotlarek
2bb740cb16
FIX: reset cache after flags are seed (#28801)
There was a bug report on meta that after deployment, some topics were not loaded properly for 24 hours - https://meta.discourse.org/t/endless-spinner-on-some-posts/323031/17

In this PR we moved the `like` post action type to the database - https://github.com/discourse/discourse/pull/28362

However, flags are cached for performance reasons https://github.com/discourse/discourse/blob/main/app/serializers/site_serializer.rb#L113

After seed, we should ensure that the cache is reset so the site has access to all post-action types.
2024-09-09 10:40:43 +10:00
Martin Brennan
622d6289e5
UX: Fix wizard link in getting started guide (#28768)
Followup e7d80cf762,
a slash was missing for the wizard link
2024-09-09 09:46:38 +10:00
dependabot[bot]
6e7b021633
Build(deps-dev): Bump @swc/core from 1.7.23 to 1.7.24 (#28795)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.7.23 to 1.7.24.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swc-project/swc/compare/v1.7.23...v1.7.24)

---
updated-dependencies:
- dependency-name: "@swc/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 01:12:31 +02:00
dependabot[bot]
e18d8d591d
Build(deps-dev): Bump simplecov-html from 0.12.3 to 0.13.0 (#28800)
Bumps [simplecov-html](https://github.com/simplecov-ruby/simplecov-html) from 0.12.3 to 0.13.0.
- [Release notes](https://github.com/simplecov-ruby/simplecov-html/releases)
- [Changelog](https://github.com/simplecov-ruby/simplecov-html/blob/main/CHANGELOG.md)
- [Commits](https://github.com/simplecov-ruby/simplecov-html/compare/v0.12.3...v0.13.0)

---
updated-dependencies:
- dependency-name: simplecov-html
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 01:12:23 +02:00
dependabot[bot]
7ab7416dfd
Build(deps-dev): Bump rubocop-rspec from 3.0.4 to 3.0.5 (#28799)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.0.4...v3.0.5)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 01:04:20 +02:00