Commit Graph

253 Commits

Author SHA1 Message Date
David Taylor ce3d91f422
DEV: Load `@json-editor/json-editor` using webpack async import (#27773) 2024-07-10 11:15:42 +01:00
David Taylor a461eaddc3
DEV: Refactor ace-editor loading and bump to latest version (#27772)
- Delete vendored copy
- Create a JS entrypoint under `static/` which imports all the modes/themes/extensions we need
- Create an async `load-ace-editor` entrypoint
- Update `<AceEditor` component to use the new entrypoint
- De-jquery-ify `<AceEditor`
- Bump `v1.4.13` -> `v1.35.2`
2024-07-09 10:09:30 +01:00
David Taylor eadda77edf
DEV: Drop diffhtml dependency (#27695)
We switched to morphlex via:

- c5f1fc3a08

- bc561eb332
2024-07-04 12:24:51 +10:00
Jarek Radosz 9adcc4ac91
DEV: Do not run theme QUnit in parallel (#27576)
Running in parallel seems to cause (unexplained so far) timeouts
2024-06-24 01:14:26 +02:00
Jarek Radosz 12661ece97
DEV: Run flake check only on discourse/discourse (#27350)
script/get_github_workflow_run_job_id.rb would fail on forks anyway
2024-06-05 18:30:37 +02:00
Jarek Radosz 0b7563b804
DEV: Fix the order of operations in themes-frontend (#27317)
Previously "themes frontend" CI job would:

1. pull compatible versions of themes that happened to be in the base image
2. clone all official themes (overriding the compatible versions from 1.)
3. run tests
2024-06-04 15:16:44 +02:00
Loïc Guitaut 2a28cda15c DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
Alan Guo Xiang Tan 67a7b28096
DEV: Don't run `discourse-ai` plugin specs when running against stable (#27095)
`discourse-ai` has custom gems which need to be bumped in order to be
compatible with Ruby 3.3. However, its version is pinned so we can't
pull in the commits in which upgrades the gems to be compatible with
Ruby 3.3. Just avoid running the specs on `stable` branch for now until
we release a new stable.
2024-05-21 12:09:40 +08:00
Alan Guo Xiang Tan 34c527d694
DEV: Pull compatible themes in tests workflow (#27093)
This commit adds a step in our tests workflow on Github actions to update the themes to
use the compatible version when not running aginast the `main` branch.
This is to ensure that we are not running
the tests for themes against an incompatible version of Discourse.
2024-05-21 10:38:41 +08:00
David Taylor f74983e2e1
DEV: Enable 'cheap source maps' in GitHub CI (#26933)
This seems to save ~7s in core build time. I also tried disabling sourcemaps completely, but it didn't bring any additional benefit.
2024-05-08 10:28:07 +01:00
David Taylor dcd994a9f1
DEV: Drop workbox dependency (#26735)
This service-worker caching functionality was disabled by default in 1c58395bca, and the setting to re-enable was marked as experimental. Now we are dropping all the related logic.
2024-04-24 10:19:12 +01:00
David Taylor 9b2628e469
DEV: Group workbox updates in dependabot (#26734) 2024-04-24 09:48:47 +01:00
Gerhard Schlager d286c1d5a1
DEV: Prepare new structure for migrations-tooling (#26631)
* Moves existing files around. All essential scripts are in `migrations/bin`, and non-essential scripts like benchmarks are in `migrations/scripts`
* Dependabot configuration for migrations-tooling (disabled for now)
* Updates test configuration for migrations-tooling
* Shorter configuration for intermediate DB for now. We will add the rest table by table.
* Adds a couple of benchmark scripts
* RSpec setup especially for migrations-tooling and the first tests
* Adds sorting/formatting to the `generate_schema` script
2024-04-15 18:47:40 +02:00
Gerhard Schlager 831da05103 DEV: Update migration-tests workflow 2024-04-15 16:22:11 +02:00
Gerhard Schlager bce7c486d8 DEV: Skip tests when unrelated GitHub config files are changed 2024-04-15 16:22:11 +02:00
Gerhard Schlager 1a9f4ec32b DEV: Skip tests when `migrations-tests` workflow is changed 2024-04-15 16:22:11 +02:00
David Taylor 8098876bfa
DEV: Restore RSpec 'documentation' output, but collapse in CI (#26485)
This reverts commit ef895f1c32 and 57df0d526e, but adds GitHub actions line grouping to the verbose output to reduce scrolling.
2024-04-03 10:54:55 +01:00
David Taylor 1e42e86601
DEV: Restore qunit 'tap' reporter, but collapse verbose output in CI (#26484)
This reverts commit 5adfb299ac, but uses GitHub actions grouping to achieve the same result: less scrolling to see failures.
2024-04-03 10:22:20 +01:00
Alan Guo Xiang Tan 337edc2f21
DEV: Update actions cache keys for bundler cache take 2 (#26411)
This is a follow up to 69c132723f which
wasn't right and broke our bundler github actions cache key
2024-03-28 10:25:58 +08:00
Alan Guo Xiang Tan 69c132723f
DEV: Update actions cache keys for bundler and app cache (#26398)
Why this change?

Bundle cache should be keyed on ruby version as well as the debian
release name. Changes to the debian release can affect the way gems are
installed since gems may link to different versions of binaries.
2024-03-28 09:20:26 +08:00
Loïc Guitaut e911362864 DEV: Use Chrome in system specs
The version of Chromium we have in our images (120) is relatively
unstable and our system specs break regularly.

This patch makes sure Chrome is used instead for system specs.
2024-03-27 12:19:55 +01:00
Alan Guo Xiang Tan 0df50a7e5d
DEV: Use the right number of cores for bundle install in tests workflow (#26389)
Why this change?

We run on different runners depending on the scenario. We should use the
right number of parallel jobs for bundle install based on the number of
CPU cores the runner has.
2024-03-27 10:19:09 +08:00
Martin Brennan 5adfb299ac
DEV: Change QUnit reporters to dot (#26360)
This is so the CI output on GitHub actions isn't showing
tons and tons of unnecessary log data every time you want
to see the important thing, which is the actual test failure.
2024-03-26 16:54:22 +10:00
Alan Guo Xiang Tan ef895f1c32
DEV: Drop documentation format on CI (#26356)
Why this change?

The output is too verbose and prevents us from quickly identifying tests
failures. Now that our tests are way more stable and less flaky, we can
drop the documentation format since we do not need it for debugging
purposes that often anymore
2024-03-26 12:03:55 +08:00
Loïc Guitaut 99921120a1 DEV: Switch to Chromium in CI
This patch switches to using Chromium in our CI jobs instead of Chrome.
2024-03-25 21:24:26 +01:00
Martin Brennan 57df0d526e
DEV: Change plugin rspec format to progress (#26098)
Having format documentation for the plugin specs just
makes a huge output that must be scrolled in order to
see the spec failures.
2024-03-08 16:12:15 +10:00
David Taylor 9f523af19c
DEV: Improve output of release-notes task to include start/end info (#26079) 2024-03-07 09:58:00 +00:00
David Taylor a9371a2a87
DEV: Fix input definition for release-notes workflow (#26077) 2024-03-07 09:17:59 +00:00
David Taylor 99b6068ede
DEV: Add release-notes GitHub workflow (#26060) 2024-03-06 17:45:38 +00:00
Jarek Radosz 299b323d9a
DEV: Update ember-cli to 5.6.0 (#25886) 2024-02-27 10:48:30 +01:00
David Taylor 588a79c80c
DEV: Merge root JS packages (#25857)
Before this commit, we had a yarn package set up in the root directory and also in `app/assets/javascripts`. That meant two `yarn install` calls and two `node_modules` directories. This commit merges them both into the root location, and updates references to node_modules.

A previous attempt can be found at https://github.com/discourse/discourse/pull/21172. This commit re-uses that script to merge the `yarn.lock` files.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-02-26 13:45:58 +00:00
David Taylor 542cb22fd4 DEV: Drop Ember 3 feature flag 2024-02-26 12:22:05 +00:00
Alan Guo Xiang Tan c08d6b0f93
DEV: Only enable turbo_rspec retry on main branch (#25827)
Why this change?

Our tests are more stable these days and there is little to no need for
us to be retrying on PRs which helps to increase confidence in our test
suite since flaky tests are raised earlier.
2024-02-26 12:35:19 +08:00
Alan Guo Xiang Tan ad0824b7e3
DEV: Fix connections timeout in system test (#25835)
Why this change?

This regressed in 6e9fbb5bab because we
had a `request.xhr?` check before we decide to block requests. However,
there could not none-xhr requests which we need to block as well at the
end of each system test when `@@block_requests` is true.

This also reverts commit 6437f27f90.
2024-02-23 16:03:46 +08:00
Alan Guo Xiang Tan 6437f27f90
DEV: Debug AR connection pool queue on CI (#25828)
Why this change?

On CI, we have been seeing flaky system tests because ActiveRecord is
unable to checkout a connection. This patch is meant to help us debug
which thread is not returning the connection to the queue.

Example of timeout issue: https://github.com/discourse/discourse/actions/runs/8012541636/job/21888013082
2024-02-23 13:37:37 +08:00
Alan Guo Xiang Tan ad900ef9dd
Revert "DEV: Debug AR connection pool queue on CI (#25687)" (#25714)
This reverts commit 796af077c5.

We have not seen checkout timeout errors since c30aeafd9d
2024-02-16 10:11:46 +08:00
Alan Guo Xiang Tan 796af077c5
DEV: Debug AR connection pool queue on CI (#25687)
Why this change?

On CI, we have been seeing flaky system tests because ActiveRecord is
unable to checkout a connection. This patch is meant to help us debug
which thread is not returning the connection to the queue.
2024-02-15 14:00:30 +08:00
Alan Guo Xiang Tan 96ae5c395f
DEV: Set database checkout timeout to 10 on CI (#25604)
Why this change?

We have been seeing checkout timeouts happening on CI when using the
default of 5 seconds. This can happen in system tests when the server
has to process many requests using the same database connection.
Therefore, we will double the timeout for now and monitor if stuff
continues to timeout.
2024-02-08 10:35:55 +08:00
Alan Guo Xiang Tan f9789e974b
DEV: Reduce pool size for test environment to 1 (#25584)
Why this change?

I have been investigating transaction related issues with our system
tests and I have a hard time figuring out what is causing the problem.
To help simplify our environment further, we will set the pool size in
the test environment to 1 so that it is impossible for us to be fetching
a different connection between the threads since they all share the
connection pool.

Also set `reaping_frequency` to `0` to ensure we don't reap any
connection ensuring the same connection is always used.
2024-02-07 11:10:17 +08:00
Alan Guo Xiang Tan 18d652c8f0
DEV: Create unlogged tables by default in the test environment (#25451)
Why this change?

In https://www.postgresql.org/docs/current/non-durability.html, it is
recommended to create unlogged tables to avoid WAL writes which can help
speed at performance at the expense of durability. In the CI env, there is no need for durability at all.
Therefore, we are going to be creating unlogged tables by default.

Co-authored-by: Ted Johansson <ted@discourse.org>
Co-authored-by: Rafael dos Santos Silva <xfalcox@gmail.com>
2024-01-29 09:57:58 +08:00
Selase Krakani 93264da206
DEV: Add script to generate schema for intermediate DB (#24484)
This will be used by migration scripts.
2024-01-22 18:45:52 +01:00
Jarek Radosz ae2d9de164
DEV: Remove "(Ember 5)" suffix from CI job names (#25347) 2024-01-22 12:10:17 +01:00
dependabot[bot] d1be9310ed
Build(deps): Bump actions/cache from 3 to 4 (#25359)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 11:50:56 +01:00
Alan Guo Xiang Tan 54e6c1d823
DEV: Allow test-prof to be disabled completely with `PREFABRICATION` env (#25294)
Why this change?

We have been looking into a flaky system tests in one of our plugins
where the DB transaction flow can be messed up from time to time. Our
debugging effort is complicated by that fact that `test-prof` starts a
DB transaction in a `before(:all)` block which makes it hard to properly
log information. By allowing test-prof to be disabled completely, we
believe it will make it easier for us to isolate the problem we are
investigating.

What does this change do?

1. Avoid loading test-prof files if `PREFABRICATION` env has been set to
   `0`.

2. Set `PREFABRICATION=0` for plugin system tests in Github actions
2024-01-17 11:00:32 +08:00
Gerhard Schlager 1f81e8d857 DEV: Add 'i18n' label to PRs which include changes related to i18n 2024-01-16 15:00:19 +01:00
Gerhard Schlager 49916b0a0c DEV: Don't run 'labeler' GitHub Action for translator-bot
It's not needed and confusing when PRs created by discourse-translator-bot have the "chat" label.
2024-01-16 15:00:19 +01:00
Gerhard Schlager 50a997a53a
DEV: labeler GitHub action was broken after upgrade to v5 (#25243)
Follow-up to 5140caf0e4
2024-01-12 16:31:18 +01:00
David Taylor 7a8cbf8422
DEV: Switch default Ember version to 5 (#25203)
https://meta.discourse.org/t/287211
2024-01-10 12:12:36 +00:00
Gerhard Schlager ce57969016
DEV: Add "migrations-tooling" label to PRs for import scripts (#25062)
Also, PRs for import scripts should automatically be assigned to the migrations-tooling group.
2023-12-28 21:26:05 +01:00
Alan Guo Xiang Tan bf3e121323
DEV: Set `config.eager_load = true` on CI (#25032)
Why this change?

When running system tests on our CI, we have been occasionally seeing
server errors like:

```
Error encountered while proccessing /stylesheets/desktop_e58cf7f686aab173f9b778797f241913c2833c39.css
  NoMethodError: undefined method `+' for nil:NilClass
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/path/pattern.rb:139:in `[]'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:127:in `block (2 levels) in find_routes'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `each'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `each_with_index'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:126:in `block in find_routes'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:123:in `map!'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:123:in `find_routes'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/journey/router.rb:32:in `serve'
    /__w/discourse/discourse/vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.7/lib/action_dispatch/routing/route_set.rb:852:in `call'
```

While looking through various Rails issues related to the error above, I
came across https://github.com/rails/rails/pull/27647 which is a fix to
fully initialize routes before the first request is handled. However,
the routes are only fully initialize only if `config.eager_load` is set
to `true`. There is no reason why `config.eager_load` shouldn't be `true` in the
CI environment and this is what a new Rails 7.1 app is generated with.

What does this change do?

Enable `config.eager_load` when `env["CI"]` is present
2023-12-26 13:05:55 +08:00