Commit Graph

775 Commits

Author SHA1 Message Date
Loïc Guitaut d6bec460a8 DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
David Taylor b3b0695bb1
PERF: Optimize themes:update task (#29290)
- Add concurrency when running on multisite clusters (default 10, configurable via THEME_UPDATE_CONCURRENCY env)

- Add a version cache for the duration of the rake task. This avoids duplicating work when many sites in the cluster have the same theme installed, and it is already up-to-date

- Updates output to be more concurrent friendly (all `puts`, no `print`)
2024-10-21 12:36:40 +01:00
Sam f6df0f8789
Revert "DEV: upgrade mini_racer (#29023)" (#29027)
This reverts commit 042bfeac66.

as expected still segfaulting
2024-09-30 14:34:04 +10:00
Sam 042bfeac66
DEV: upgrade mini_racer (#29023)
This is attempt 5 at upgrading mini racer, fixes some edge conditions in
mini_racer that can lead to segfaults.
2024-09-30 09:12:14 +10:00
Sam Saffron f22316d0cd Revert "DEV: attempt another upgrade on mini_racer (#28951)"
This reverts commit 68e017c324.

Still seeing faults ... we had 1 segfault in 7 hours.
2024-09-19 09:48:01 +10:00
Loïc Guitaut 05b8ff436c DEV: Introduce a `Service::ActionBase` class for service actions
This will help to enforce a consistent pattern for creating service
actions.

This patch also namespaces actions and policies, making everything
related to a service available directly in
`app/services/<concept-name>`, making things more consistent at that
level too.
2024-09-18 17:02:46 +02:00
Sam 68e017c324
DEV: attempt another upgrade on mini_racer (#28951)
This time the compile disables strict aliasing to see if it resolves the issue
2024-09-18 08:44:26 +10:00
Sam 991227337a
Revert "DEV: attempt a mini_racer upgrade (#28924)" (#28925)
This reverts commit dc8620a491.

Still segfaulting - missing artifact for ARM darwin
2024-09-16 12:10:32 +10:00
Sam dc8620a491
DEV: attempt a mini_racer upgrade (#28924)
This is attempt 4 or 5. This time we compiled libv8-node using clang vs gcc.

The working theory is that something may be off with the gcc compile.
2024-09-16 08:38:40 +10:00
Jarek Radosz 6a677d1cfc
DEV: Remove dynamic inclusions from Gemfile (#28847)
Added in 7c3a29c, broke Dependabot parsing.
2024-09-11 13:39:15 +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
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
Sam c2b49bd095
DEV: update mini_racer to latest (#28796)
The latest node 22.7.0 based release of mini_racer disabled
Maglev (https://v8.dev/blog/maglev) based optimisations

From previous segfaults it appears the failures happened in the maglev code
paths.

Node release of v8 lags latest release of v8 so, whatever is happening, may
be resolved in latest.
2024-09-09 08:46:42 +10:00
Loïc Guitaut d8009fd0ec DEV: Remove unneeded dependencies
Now that we’re using Rails 7.1, we don’t need to have the `mutex_m` and
`drb` gems explicitly listed in our Gemfile.
2024-09-06 13:14:22 +02:00
Sam dfab7d1eca
Revert "DEV: another attempt upgrading mini_racer (#28763)" (#28769)
This reverts commit 5c0c053b11.

This still segfaults, but not as frequently as before, we will keep this
for a few more hours and then revert
2024-09-06 16:23:57 +10:00
Sam 5c0c053b11
DEV: another attempt upgrading mini_racer (#28763)
New version disable concurrent GC sweeping in V8 it was a culprit for
segfaults we saw in production
2024-09-06 08:12:58 +10:00
Loïc Guitaut 9e9d88f078 DEV: Use rspec mocks to properly verify a race condition
This is a small followup of https://github.com/discourse/discourse/pull/28124.
2024-08-06 15:57:04 +02:00
Loïc Guitaut 301713ef96 DEV: Upgrade the MessageFormat library (JS)
This patch upgrades the MessageFormat library to version 3.3.0 from
0.1.5.

Our `I18n.messageFormat` method signature is unchanged, and now uses the
new API under the hood.

We don’t need dedicated locale files for handling pluralization rules
anymore as everything is now included by the library itself.

The compilation of the messages now happens through our
`messageformat-wrapper` gem. It then outputs an ES module that includes
all its needed dependencies.

Most of the changes happen in `JsLocaleHelper` and in the `ExtraLocales`
controller.

A new method called `.output_MF` has been introduced in
`JsLocaleHelper`. It handles all the fetching, compiling and
transpiling to generate the proper MF messages in JS. Overrides and
fallbacks are also handled directly in this method.

The other main change is that now the MF translations are served through
the `ExtraLocales` controller instead of being statically compiled in a
JS file, then having to patch the messages using overrides and
fallbacks. Now the MF translations are just another bundle that is
created on the fly and cached by the client.
2024-07-10 09:51:25 +02:00
Alan Guo Xiang Tan 28f5550886
DEV: Redo `DiscourseLogstashLogger` to not rely on `logstash-logger` (#27759)
This reverts commit 92d7d24d0f.
2024-07-08 14:03:11 +08:00
Alan Guo Xiang Tan 92d7d24d0f
Revert "DEV: Redo `DiscourseLogstashLogger` to not rely on `logstash-logger` (#27663)" (#27733)
This reverts commit 8e10878e1a.

Something is broken on a friday so reverting first before I pick this up
again next Monday.
2024-07-05 17:26:58 +08:00
Alan Guo Xiang Tan 8e10878e1a
DEV: Redo `DiscourseLogstashLogger` to not rely on `logstash-logger` (#27663)
This commit rewrites `DiscourseLogstashLogger` to not be an instance
of `LogstashLogger`. The reason we don't want it to be an instance of
`LogstashLogger` is because we want the new logger to be chained to
Logster's logger which can then pass down useful information like the
request's env and error backtraces which Logster has already gathered.

Note that this commit does not bother to maintain backwards
compatibility and drops the `LOGSTASH_URI` and `UNICORN_LOGSTASH_URI`
ENV variables which were previously used to configure the destination in
which `logstash-logger` would send the logs to. Instead, we introduce
the `ENABLE_LOGSTASH_LOGGER` ENV variable to replace both ENV and remove
the need for the log paths to be specified. Note that the previous
feature was considered experimental as stated in d888d3c54c
and the new feature should be considered experimental as well. The code
may be moved into a plugin in the future.
2024-07-05 09:41:52 +08:00
Loïc Guitaut 8d249457e8 DEV: Upgrade Rails to version 7.1
---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-07-04 10:58:21 +02:00
Loïc Guitaut f58b844f45
Revert "DEV: Upgrade Rails to version 7.1" (#27625)
This reverts commit ce00f83173.
2024-06-26 18:55:05 +02:00
Loïc Guitaut ce00f83173 DEV: Upgrade Rails to version 7.1
---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-06-24 11:16:14 +02:00
Loïc Guitaut 160011793a Revert "DEV: Upgrade Rails to version 7.1 (#27539)"
This reverts commit ca4af53be8.
2024-06-21 11:20:40 +02:00
Loïc Guitaut ca4af53be8 DEV: Upgrade Rails to version 7.1 (#27539)
* DEV: Upgrade Rails to 7.1

* FIX: Remove references to `Rails.logger.chained`

`Rails.logger.chained` was provided by Logster before Rails 7.1
introduced their broadcast logger. Now all the loggers are added to
`Rails.logger.broadcasts`.

Some code in our initializers was still using `chained` instead of
`broadcasts`.

* DEV: Make parameters optional to all FakeLogger methods

* FIX: Set `override_level` on Logster loggers (#27519)

A followup to f595d599dd

* FIX: Don’t duplicate Rack response

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-06-21 09:44:06 +02:00
Loïc Guitaut 982c005979 Revert "DEV: Upgrade Rails to version 7.1 (#27539)"
This reverts commit 2301dddcff.
2024-06-20 11:43:35 +02:00
Loïc Guitaut 2301dddcff
DEV: Upgrade Rails to version 7.1 (#27539)
* DEV: Upgrade Rails to 7.1

* FIX: Remove references to `Rails.logger.chained`

`Rails.logger.chained` was provided by Logster before Rails 7.1
introduced their broadcast logger. Now all the loggers are added to
`Rails.logger.broadcasts`.

Some code in our initializers was still using `chained` instead of
`broadcasts`.

* DEV: Make parameters optional to all FakeLogger methods

* FIX: Set `override_level` on Logster loggers (#27519)

A followup to f595d599dd

* FIX: Don’t duplicate Rack response

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-06-20 10:33:01 +02:00
Jarek Radosz 5cb84f8dcf
DEV: Revert rails 7.1 upgrade (#27522)
* Revert "FIX: Set `override_level` on Logster loggers (#27519)"

This reverts commit c1b0488c54.

* Revert "DEV: Make parameters optional to all FakeLogger methods"

This reverts commit 3318dad7b4.

* Revert "FIX: Remove references to `Rails.logger.chained`"

This reverts commit f595d599dd.

* Revert "DEV: Upgrade Rails to 7.1"

This reverts commit 081b00391e.
2024-06-18 23:48:30 +02:00
Loïc Guitaut 081b00391e DEV: Upgrade Rails to 7.1 2024-06-18 15:58:05 +02:00
Alan Guo Xiang Tan 82be988313
DEV: Add `mutex_m` and `drb` to Gemfile to remove deprecation warning (#27012)
Resolves the following deprecation warnings when running Discourse on
Ruby 3.3

```
warning: /Users/tgxworld/.asdf/installs/ruby/3.3.1/lib/ruby/3.3.0/mutex_m.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add mutex_m to your Gemfile or gemspec. Also contact author of activesupport-7.0.8.1 to add mutex_m into its gemspec.

warning: /Users/tgxworld/.asdf/installs/ruby/3.3.1/lib/ruby/3.3.0/drb.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add drb to your Gemfile or gemspec. Also contact author of activesupport-7.0.8.1 to add drb into its gemspec.
```
2024-05-15 05:44:50 +08:00
Alan Guo Xiang Tan 507e8d3120
DEV: Add `csv` to Gemfile to resolve Ruby 3.3 deprecation warning (#26995)
The following warning is being printed when running Discourse with Ruby
3.3

`warning: /usr/local/lib/ruby/3.3.0/csv.rb was loaded from the standard
library, but will no longer be part of the default gems since Ruby
3.4.0. Add csv to your Gemfile or gemspec.`
2024-05-13 13:23:15 +08:00
Martin Brennan acc5b01e21
DEV: Add pry-stack_explorer again (#26763)
This was reverted in 26a387c9c6
because the other pry gem changes there broke prod -- it
should be safe to just add this dev/test dependency
2024-04-29 10:34:28 +10:00
David Taylor 26a387c9c6
Revert "DEV: Add pry-stack_explorer plugin gem (#26732)" (#26739)
This reverts commit 09f5af608f.

Moving all the `pry` gems to the development group broke `rails c` functionality in production
2024-04-24 13:03:35 +01:00
Martin Brennan 09f5af608f
DEV: Add pry-stack_explorer plugin gem (#26732)
This is only required in rails_helper, otherwise it is
not loaded. Allows for better debugging by allowing
navigation of the call stack from the point of `binding.pry`

c.f. https://github.com/pry/pry-stack_explorer
2024-04-24 14:35:21 +10:00
Keenan Brock fdff9b06a5
DEV: Peg redis client to 4.0 (#26104)
Peg redis to 4.0 and explain it still does not work on 5.0
2024-04-19 17:22:12 +10:00
Osama Sayegh b8d04fca88
DEV: Move automation dependencies to core's Gemfile (#26531)
Moving the automation plugin dependencies to core allows us to receive automatic notifications about new releases for those gems.

Internal topic: t/112693/54.
2024-04-05 14:17:30 +03:00
Jarek Radosz 49409f4985
DEV: Use the release version of sprockets (#26490) 2024-04-04 10:58:19 +08:00
Alan Guo Xiang Tan 6cfeb62c29
DEV: Drop fast_xs gem (#26442)
Why this gem?

This gem was added close to 10 years ago to speed up the generation of
RSS feeds. However, RSS feeds generation do not even call `String#to_xs`
anymore and the `fast_xs` gem does not install on macOS without using
the following workaround:

`bundle config build.fast_xs
--with-cflags=\"-Wno-incompatible-pointer-types\"`

Therefore, we have decided to drop the gem.
2024-04-01 07:54:27 +08:00
Alan Guo Xiang Tan 5c6b5612e7
DEV: Drop gc_tracer gem (#26441)
Why this change?

This gem is failing to install cleanly on macOS and the following
workaround is required:

`bundle config build.gc_tracer
--with-cflags=\"-Wno-incompatible-pointer-types\"`

Instead of requiring this workaround, we have decided to drop `gc_tracer`
because it isn't a gem that is used anymore.
2024-04-01 07:54:18 +08:00
David Taylor dfc6bb4029
DEV: Remove direct minitest dependency to appease ruby-lsp (#26056)
Having minitest as a direct dependency causes ruby-lsp to use it as our test runner (per https://github.com/Shopify/ruby-lsp/blob/d1da8858a1/lib/ruby_lsp/requests/support/dependency_detector.rb#L40-L55). This makes VSCode's test explorer incorrectly display Minitest 'run' buttons above all our tests.

We were only using it in `emoji.rake`... and that wasn't even working with the latest version of Minitest. This commit refactors `emoji.rake` to work without minitest, and removes the dependency.
2024-03-06 15:41:14 +00:00
Jarek Radosz abbc6cf314
DEV: Update shoulda-matchers to 6.1.0 (#25362)
No need to stay on the git version anymore
2024-01-22 12:12:51 +01:00
Alan Guo Xiang Tan 6b8e051e73
DEV: Update Rails to 7.0.8 (#25084)
See https://github.com/rails/rails/releases/tag/v7.0.8
2024-01-02 10:19:08 +08:00
Jarek Radosz c2617c25bb
DEV: Update rbtrace to 0.5.1 (#24964) 2023-12-19 20:59:21 +01:00
Alan Guo Xiang Tan 552f035609
DEV: Pin rbtrace gem to 0.4.14 (#24961)
Why this change?

rbtrace 0.5.0 has a bug which is preventing the rbtrace CLI from
working. The bug has been fixed in 1c67488569
but we are waiting for a new version to be release with the fix.
2023-12-19 17:59:09 +11:00
Gerhard Schlager 1cb600270e DEV: Convert dependencies of generic import script into optional gem group 2023-12-11 16:23:07 +01:00
Penar Musaraj 28956a5415
DEV: Switch to sassc-embedded (#24639)
Sassc-embedded fixes a performance issue with a leaking DartSass process. And it also fixes an issue with source map file paths (without any extra flags).
2023-12-08 10:34:03 -05:00
Jarek Radosz 5b91dc1844
DEV: Set a browser read timeout in capybara (#24757) 2023-12-07 23:46:20 +01:00
Roman Blanco 1a8b1fc698
DEV: Bump rswag-specs from 2.11.0 to 2.13.0 (#24654) 2023-12-07 08:16:47 +08:00
David Taylor cbc5694b77
DEV: Remove RAILS_MASTER flag from Gemfile (#24574)
We don't use this flag, and it prevents Dependabot from being able to automatically create PRs for Rails gem updates
2023-11-28 09:36:23 +00:00