Commit Graph
350 Commits
Author SHA1 Message Date
Jarek Radosz 383e484fe2 DEV: Move discourse-graphviz to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 683ee9c353 DEV: Move discourse-patreon to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 5e86f2c21f DEV: Move discourse-zendesk-plugin to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 4525a9aeb4 DEV: Move discourse-openid-connect to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 3d00a1389a DEV: Move discourse-oauth2-basic to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 4fa3a17211 DEV: Move discourse-lti to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 1cebc0643d DEV: Move discourse-login-with-amazon to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 336d23f7e4 DEV: Move discourse-microsoft-auth to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 863c3ecb1a DEV: Move discourse-apple-auth to core (#33570)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-15 16:38:05 +02:00
Jarek Radosz 378bed012c DEV: Improve separation of core and plugin CI (#33583)
1. Use separate caches for plugins and core
2. Don't load plugins in non-plugin jobs
3. Propagate LOAD_PLUGINS to all steps
4. Check annotations of plugin models
5. Update outdated annotations
2025-07-14 14:28:30 +02:00
Natalie Tay 6c95779712 DEV: Add extra permission to allow labeller to work in PRs (#33579)
Seeing the following in
https://github.com/discourse/discourse/actions/runs/16209614945/job/45767099809?pr=33577

```
The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: HttpError: You do not have permission to create labels on this repository.: {"resource":"Repository","field":"label","code":"unauthorized"}
Error: You do not have permission to create labels on this repository.: {"resource":"Repository","field":"label","code":"unauthorized"}
```

Related: https://github.com/orgs/community/discussions/156181
2025-07-11 15:02:54 +08:00
Jarek Radosz 620883cd13 DEV: Move discourse-reactions to core (#33538)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-10 11:40:31 +01:00
Jarek Radosz 22d3140c3a DEV: Label all bundled plugin PRs (#33560) 2025-07-10 11:16:34 +01:00
David Taylor 25f6984006 DEV: Add SKIP_DB_AND_REDIS bootability check to CI (#33158) 2025-06-11 16:25:24 +01:00
Alan Guo Xiang Tan b7865cdfe1 DEV: Run plugin system tests job on 16 core runners (#32767)
This is the bottleneck for the `tests` workflow now so we are throwing
more cores at the job
2025-05-16 16:33:01 +08:00
Alan Guo Xiang Tan fee57fe1c3 DEV: Update labels for our self hosted runners (#32766)
We have 8 and 16 cores runner now but 16 core runners are not quite
ready for prime time yet.
2025-05-16 15:46:14 +08:00
Joffrey JAFFEUX addaa03192 DEV: uses local playwright chromium for now (#32613)
We have had multiple issues while using the chrome channel:
- super slow start of the spec, I can confirm I don't have it on
chromium
- more risk of different failures between local dev machines and CI

There was a test not working on chromium, as it doesn't have mp4 codecs
out of the box. I changed the spec to use webm instead and it's now
working correctly.

This commit also fixes a bug with the video/trace paths which were
incorrect, and also makes another test less flakey with uploads event
though Im not very clear on what is going on here, we need to dig this.

We now need to figure out a way to have this on the test image, but this
is for now a better solution.
2025-05-07 10:17:25 +02:00
Alan Guo Xiang Tan 3f070bd76f DEV: Fix typo in tests workflow (#32611) 2025-05-07 07:15:49 +08:00
Joffrey JAFFEUX b6aad28ccf DEV: replace selenium driver with playwright (#31977)
This commit is replacing the system specs driver (selenium) by
Playwright: https://playwright.dev/

We are still using Capybara to write the specs but they will now be run
by Playwright. To achieve this we are using the non official ruby
driver: https://github.com/YusukeIwaki/capybara-playwright-driver

### Notable changes

- `CHROME_DEV_TOOLS` has been removed, it's not working well with
playwright use `pause_test` and inspect browser for now.

- `fill_in` is not generating key events in playwright, use `send_keys`
if you need this.

### New spec options

#### trace

Allows to capture a trace in a zip file which you can load at
https://trace.playwright.dev or locally through `npx playwright
show-trace /path/to/trace.zip`

_Example usage:_

```ruby
it "shows bar", trace: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

#### video

Allows to capture a video of your spec.

_Example usage:_

```ruby
it "shows bar", video: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

### New env variable

#### PLAYWRIGHT_SLOW_MO_MS

Allow to force playwright to wait DURATION (in ms) at each action.

_Example usage:_

```
PLAYWRIGHT_SLOW_MO_MS=1000 rspec foo_spec.rb
```

#### PLAYWRIGHT_HEADLESS

Allow to be in headless mode or not. Default will be headless.

_Example usage:_

```
PLAYWRIGHT_HEADLESS=0 rspec foo_spec.rb # will show the browser
```

### New helpers

#### with_logs

Allows to access the browser logs and check if something specific has
been logged.

_Example usage:_

```ruby
with_logs do |logger|
  # do something

  expect(logger.logs.map { |log| log[:message] }).to include("foo")
end
```

#### add_cookie

Allows to add a cookie on the browser session.

_Example usage:_

```ruby
add_cookie(name: "destination_url", value: "/new")
```

#### get_style

Get the property style value of an element.

_Example usage:_

```ruby
expect(get_style(find(".foo"), "height")).to eq("200px")
```

#### get_rgb_color

Get the rgb color of an element.

_Example usage:_

```ruby
expect(get_rgb_color(find("html"), "backgroundColor")).to eq("rgb(170, 51, 159)")
```
2025-05-06 10:44:14 +02:00
Alan Guo Xiang Tan 55f09ed73f Revert "DEV: Update workflow concurrency controls to use github.ref_name (#32524)" (#32592)
This reverts commit 427d4d2b53.

This prevents us from knowing which commit broke the build. Revert for
now while we figure out a better solution.
2025-05-06 15:43:57 +08:00
Alan Guo Xiang Tan 427d4d2b53 DEV: Update workflow concurrency controls to use github.ref_name (#32524)
`github.ref_name` is

> The short ref name of the branch or tag that triggered the workflow
run. This value matches the branch or tag name shown on GitHub. For
example, feature-branch-1.
> 
> For pull requests, the format is <pr_number>/merge.

Not sure why we use `github.run_number` when it is a unique number for
each run of a workflow. `github.head_ref` is only present on pull
request events so it is blank when the workflow is ran on
other branches.

By updating the key to `github.ref_name` + `github.job` we ensure that
only one workflow will be running for a given PR or branch.
2025-05-01 16:02:08 +10:00
Alan Guo Xiang Tan 6a1dc50895 DEV: Stop running core annotations check as a standalone job (#32470)
Merging the core annotation check into the core backend job reduces the
number of runners required per workflow from 15 to 14. Before this
change, the core annotations job occupies a runner for about 1 min
30 secs in order to spend 9 seconds running the core annotations check.
2025-04-25 23:18:55 +08:00
Alan Guo Xiang Tan bc94909763 DEV: Bump tests workflow build job timeout for plugin system tests (#32469)
While the step to run plugin system tests has been set with a timeout of
30 minutes, the overall job timeout was only set to 20 minutes. As a
result, we are starting to see the plugin system tests job fail due to
the job exceeding the 20 minutes timeout.

### Reviewer notes 

Example of plugin system tests exceeding 20 minutes timeout:
https://github.com/discourse/discourse/actions/runs/14665943355/job/41160611627
2025-04-25 16:55:11 +02:00
Alan Guo Xiang Tan 0252712008 DEV: Add --exclude-pattern to bin/turbo_rspec (#32390)
This commit adds a new `--exclude-pattern` CLI option which supports
excluding files using unix style pattern matching.

This is to simplify a couple of situations:

1. Running `bin/turbo_rspec plugin/spec` but we want to exclude all
   tests in the `plugin/spec/system` folder.

   Example: `bin/turbo_rspec --exclude-pattern="*spec/system*"
plugin/spec`

2. Running `bin/turbo_rspec plugin/*/spec/system` but we want to exclude
   tests for a particular plugin.

   Example: `bin/turbo_rspec --exclude-pattern="plugins/chat/*"
plugin/*/spec/system`
2025-04-22 11:34:48 +08:00
David Taylor f3d3c61754 PERF: Reuse existing core JS build where possible (#32311)
Building the Discourse JS app is very resource-intensive. This commit
introduces an `assemble_ember_build` script which will check the
existing content of the `dist/` directory and re-use the core build if
possible. Plugins will always be rebuilt.

For now, this functionality is only useful for multi-stage (i.e.
non-standard) Discourse deployments. But in future, this script may be
extended to pull the contents of the `dist/` directory from a remote
location.
2025-04-15 16:18:22 +01:00
Gerhard Schlager 17ba19c7ae REFACTOR: Code generator for migrations IntemerdiateDB
* Splits the existing script into multiple classes
* Adds command for generating IntermediateDB schema (`migrations/bin/cli schema generate`)
* Changes the syntax of the IntermediateDB schema config
* Adds validation for the schema config
* It uses YAML schema aka JSON schema to validate the config file
* It generates the SQL schema file and Ruby classes for storing data in the IntermediateDB
2025-04-07 17:22:36 +02:00
Gerhard Schlager 71a90dcba2 DEV: Refactor migrations-tooling
* Updates GitHub Action for migrations
* Rubocop: Always `EnforcedShorthandSyntax` for hashes in the `migrations` directory
* Automatically load all available converter steps
* Enable YJIT at runtime, if available
* Progressbar shows skipped records and other small improvements
2025-04-07 17:22:36 +02:00
Alan Guo Xiang Tan 0724b03fb8 DEV: Bump Capybara.default_max_wait_time to 20 on CI (#32143)
There are flaky system tests that have been exhausting the 10 seconds
default max wait time which we have set previously on CI. However, I
have yet to be able to figure out why and lack the tools to be able to
figure out why. The hope here is that the upcoming playwright driver
will provide us with better tooling to debug such problems.

I've attempted to use `Capybara::Session#using_wait_time` by there is
some race condition going on where the session's default max wait time
is sometimes not set properly. I can't figure out why and have spent too
much time trying to figure out why. Instead, I will just bump up the
`default_max_wait_time` to `20`. This may the build take longer when
there are test failures but it is a trade-off we will make right now.
2025-04-04 12:50:28 +08:00
Jarek Radosz 61b5408ab9 DEV: Group prosemirror dependabot updates (#32041) 2025-03-27 17:19:02 +01:00
David Taylor 8c9885d0bf Revert "DEV: Adds empty device screenshot workflow file (#31521)" (#31973)
This reverts commit 0af0087c77.
2025-03-24 12:01:13 +00:00
Alan Guo Xiang Tan f6860dcb92 DEV: Remove installing minio binaries in tests workflow (#31652)
In the `discourse/discourse_test:release` base image, the minio binaries
are already being installed and updated on a daily basis. There is also
no
real need for us to have to run the latest minio binaries once it is
released. As such, we can drop the step in the `tests` workflow.
2025-03-06 10:04:07 +11:00
Loïc Guitaut 4b3044565d DEV: Check Gemfile.lock is up to date on CI 2025-03-04 16:29:50 +01:00
Jarek Radosz 024d752083 DEV: Remove extraneous rubocop arguments (#31596)
1. `--parallel` is the default
2. it runs in the current directory by default
2025-03-04 01:28:26 +01:00
Martin Brennan 0af0087c77 DEV: Adds empty device screenshot workflow file (#31521)
This is for continued experimentation in
https://github.com/discourse/discourse/pull/31410,
GitHub does not react to the issue_comment event unless the workflow
file is in main already,
see
https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#issue_comment

This workflow is a noop, it will be actually written/tested
in the linked PR
2025-02-27 10:07:29 +10:00
David Taylor 00907363d4 DEV: Drop ember-cli-based SCSS and locale compilation (#31407)
This totally separate SCSS and i18n compilation pipelines only existed
so that we could run `ember exam` in CI without starting Rails.

Now that our CI has such heavy caching of Ruby dependencies and database
migrations, the speed benefit of this is not worth the cost of
maintaining these separate pipelines.

Therefore, this commit removes that system, and updates CI to use
`bin/rake qunit:test`. That will start up a Rails server and proxy
stylesheet/locale requests to it. This strategy was already used for our
theme and plugin qunit test runs.
2025-02-21 11:15:04 +00:00
Jarek Radosz 3e22fc8ba2 DEV: Update sass gems/package (#31396)
…and temporarily silence the new deprecations: color-functions, import, global-builtin.
2025-02-19 20:04:17 +01:00
Jarek Radosz 6c70825d3d DEV: Fix pnpm dedupe workflow branch matching (#31322)
It was missing branches for updated namespaced packages
2025-02-12 23:22:26 +01:00
Jarek Radosz b290c557b8 DEV: Don't run scripts on pnpm dedupe (#31274) 2025-02-11 13:57:02 +01:00
David Taylor db139534d2 DEV: Drop d-crowd plugin from official list (#31258)
This repo was archived in March 2024 and is no longer supported.

Commit also fixes up the plugin-gem-symlinking logic to support removing
plugins from the list
2025-02-10 15:08:31 +00:00
Jarek RadoszandDiscourse CI 09bc785fbf DEV: Fix pnpm dedupe workflow and lock pnpm version (#31244)
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-02-10 14:18:52 +01:00
David Taylor 6d6e9c174d DEV: Switch to 'unstable' glint dependencies (#31169)
This may help to resolve the "ScriptType" errors we're seeing in the
language server
2025-02-04 17:32:00 +00:00
Jarek Radosz 1613770290 DEV: Add a message to dedupe / mind the exit code (#31070) 2025-01-30 13:13:57 +01:00
Jarek Radosz 42aea3ff1c DEV: Fix the dedupe workflow (#31067)
(and specify permissions)
2025-01-30 12:56:03 +01:00
Jarek Radosz 7dcae416ad DEV: Run pnpm dedupe on Dependabot PRs (#30950) 2025-01-28 13:16:33 +01:00
David Taylor 2f19b17cd7 DEV: Remove DISCOURSE_HOSTNAME from test workflow (#30984)
This could cause assets (e.g. fonts) to try and load from
`www.example.com`, which led to an error. In the case of theme-qunit
tests this actually caused the run to fail. Not entirely sure why...
font failures shouldn't be catastrophic... but this is a good fix
regardless.
2025-01-24 10:35:57 +01:00
David TaylorandJoffrey JAFFEUX d88ee33eb6 DEV: Introduce stylelint (#29852)
Stylelint is a css linter: https://stylelint.io/

As part of this change we have added two javascript scripts:

```
pnpm lint:css
pnpm lint:css:fix
```

Look at `.vscode/settings.json.sample` and `.vscode/extensions.json` for
configuration in VSCode.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-20 15:27:42 +00:00
Alan Guo Xiang Tan e63a804ec9 DEV: Remove unused step in tests workflow (#30838) 2025-01-17 13:39:54 +08:00
David Taylor 0fc2d86259 DEV: Remove pull_request_template (#30709)
We'd like to enable the "default commit message: pull request title and body" option for squash merges. That means we need PR bodies to be clean, and do not want HTML comments like this template to end up becoming part of the commit message body.
2025-01-13 09:27:06 +10:00
David Taylor ac60ba5954 DEV: Update dependabot commit-message splitting (#30721)
Followup to c6da8e3356
2025-01-10 20:58:50 +00:00
David Taylor c6da8e3356 DEV: Add workflow to replace dependabot PR bodies with plaintext (#30708)
We'd like to enable the "default commit message: pull request title and body" option for squash merges. That doesn't currently work well for dependabot PRs, because the PR body includes rich HTML.

Therefore, this commit introduces a new workflow which replaces any dependabot PR bodies with plaintext content from the commit message. The original rich content will be added in a comment.
2025-01-10 19:12:55 +00:00