Commit Graph

52234 Commits

Author SHA1 Message Date
Krzysztof Kotlarek
702d0620d7
DEV: Convert min_trust_to_create_topic to groups (#24740)
This change converts the min_trust_to_create_topic site setting to
create_topic_allowed_groups.

See: https://meta.discourse.org/t/283408

- Hides the old setting
- Adds the new site setting
- Add a deprecation warning
- Updates to use the new setting
- Adds a migration to fill in the new setting if the old setting was
changed
- Adds an entry to the site_setting.keywords section
- Updates tests to account for the new change
- After a couple of months, we will remove the min_trust_to_create_topicsetting entirely.

Internal ref: /t/117248
2023-12-13 14:50:13 +11:00
Krzysztof Kotlarek
1017820012
DEV: Convert allow_uploaded_avatars to groups (#24810)
This change converts the allow_uploaded_avatars site setting to uploaded_avatars_allowed_groups.

See: https://meta.discourse.org/t/283408

Hides the old setting
Adds the new site setting
Adds a deprecation warning
Updates to use the new setting
Adds a migration to fill in the new setting if the old setting was changed
Adds an entry to the site_setting.keywords section
Updates tests to account for the new change
After a couple of months, we will remove the allow_uploaded_avatars setting entirely.

Internal ref: /t/117248
2023-12-13 10:53:19 +11:00
Jarek Radosz
8355664c82
FIX: Don't use :true/:false symbols (#24861)
on line 252 `has_children` is set to true/false (actual booleans) which means `has_children?` was in some cases returning incorrect value…
2023-12-13 00:27:14 +01:00
Jarek Radosz
607c530252
DEV: Remove ruby 1.9/2.0 benchmark (#24862) 2023-12-13 07:22:15 +08:00
Alan Guo Xiang Tan
39da9106ba
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?

Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.

What does this change do?

This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to 
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests 
which have been logged for internal monitoring.

How is the change implemented?

1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner` 
with the `retry_and_log_flaky_tests` kwarg set to `true`. 

2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional 
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method. 
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the 
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.

3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
Krzysztof Kotlarek
5055e431a8
DEV: Custom generator for rename site setting migration (#24841)
Ability to automatically generate migration when site setting name is changed.
Example usage: `rails generate site_setting_rename_migration site_description contact_email`
2023-12-13 09:58:45 +11:00
dependabot[bot]
6755fd3b62
Build(deps-dev): Bump debug_inspector from 1.1.0 to 1.2.0 (#24860)
Bumps [debug_inspector](https://github.com/banister/debug_inspector) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/banister/debug_inspector/releases)
- [Commits](https://github.com/banister/debug_inspector/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: debug_inspector
  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>
2023-12-12 23:14:59 +01:00
dependabot[bot]
8845e202ef
Build(deps-dev): Bump shoulda-matchers from f2db1f2 to baabf89 (#24858)
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from `f2db1f2` to `baabf89`.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Commits](f2db1f2f56...baabf89127)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 23:14:51 +01:00
dependabot[bot]
56c18d1e12
Build(deps): Bump net-imap from 0.4.7 to 0.4.8 (#24859)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.4.7 to 0.4.8.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.4.7...v0.4.8)

---
updated-dependencies:
- dependency-name: net-imap
  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>
2023-12-12 23:14:26 +01:00
dependabot[bot]
d782f9b995
Build(deps): Bump oj from 3.16.2 to 3.16.3 (#24856)
Bumps [oj](https://github.com/ohler55/oj) from 3.16.2 to 3.16.3.
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.16.2...v3.16.3)

---
updated-dependencies:
- dependency-name: oj
  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>
2023-12-12 23:11:52 +01:00
dependabot[bot]
3d03d9f090
Build(deps-dev): Bump test-prof from 1.3.0 to 1.3.1 (#24855)
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: test-prof
  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>
2023-12-12 23:10:28 +01:00
Jordan Vidrine
67594353ae
UX: Align icon with username in menu panel (#24854) 2023-12-12 15:32:16 -06:00
David Taylor
0f3a6cf042
DEV: Improve browser-update compatibility (#24852)
Now that we're using native `import()`, our main JS bundles might not even be parse-able by older browsers. In that case, `I18n` will never be defined, and so we need to account for that situation in the browser-update code.
2023-12-12 21:09:14 +00:00
Mark VanLandingham
097cef7d21
UX: Improve layout of avatar+icon notifications (#24851) 2023-12-12 14:28:29 -06:00
Rafael dos Santos Silva
de936f07e5
PERF: Update node_options during ember build for low end servers (#24850)
See https://meta.discourse.org/t/286643/14

Co-authored-by: David Taylor <david@taylorhq.com>
2023-12-12 17:05:20 +00:00
Angus McLeod
95c61b88dc
Apply embed unlisted setting consistently (#24294)
Applies the embed_unlisted site setting consistently across topic embeds, including those created via the WP Discourse plugin. Relatedly, adds a embed exception to can_create_unlisted_topic? check. Users creating embedded topics are not always staff.
2023-12-12 09:35:26 -05:00
Discourse Translator Bot
7d0562f10e
Update translations (#24848) 2023-12-12 14:23:51 +01:00
Joffrey JAFFEUX
875966cc9e
FIX: ensures border and shadow of header is visible (#24847) 2023-12-12 14:18:36 +01:00
Selase Krakani
90eff6f344
FIX: Remove duplicate spec example (#24846) 2023-12-12 13:48:23 +01:00
chapoi
f6644a69c3
UX: prevent header buttons from wrapping text (#24845) 2023-12-12 13:31:49 +01:00
Jarek Radosz
41942357ed
DEV: Use class attribute instead of @class arg (#24804) 2023-12-12 13:09:05 +01:00
Jarek Radosz
86b9e784dc
DEV: Re-enable browser read timeout in specs (#24844)
Turns out there's an easier (and properly working) way to do this!

See: 52eaecea6d/lib/capybara/selenium/driver.rb (L68C42-L68C42)
2023-12-12 12:29:23 +01:00
Joffrey JAFFEUX
fca67117ee
FIX: incorrect spacing with my threads on ios (#24843)
- sticky doesn't work well with overflow: hidden parents. These overflows were used to hide other issues which shouldn't exist anyways. If it causes issues we should fix the root cause.

- our `--header-offset` is changing a lot on safari while scrolling, sometimes with very unexpected value like: negative or very high value, which causes the navbar to appear at unexpected positions for few ms, this commit is using the value of the header on insert and not changing it after, it shouldn't cause any issue.
2023-12-12 11:32:36 +01:00
David Battersby
22d8978eb4
FIX: increase default max length of chat message excerpts (#24842)
Increases the default max length of message excerpts to allow for longer titles in threads index.
2023-12-12 18:24:07 +08:00
Alan Guo Xiang Tan
775dce1f13
DEV: Partially revert 5b91dc1844 (#24838)
Why this change?

The code changes introduced in 5b91dc1844
resulted in errors being raised when `session.quit` is called when using
multiple sessions. From my debugging, this seems to be attributed to the
fact that the change introduced resulted in multiple sessions sharing
the same instance of `Selenium::WebDriver::Remote::Http::Default`. While
sharing the same instance in theory should be fine, but the problem is
that `Selenium::WebDriver::Driver` will mutate the `server_url` of the
client in `Selenium::WebDriver::Remote::Bridge`. This is problematic
because each session created by capbyara relies on a different server
URL and this mutation causes all sorts of weird errors to occur.

To reproduce the problem, run `LOAD_PLUGINS=1 rspec plugins/chat/spec/system/send_message_spec.rb:76`
locally while excluding the changes in this commit.
2023-12-12 12:39:23 +08:00
Krzysztof Kotlarek
7dd150bc95
DEV: Convert min_trust_to_edit_wiki_post to groups (#24766)
This change converts the min_trust_to_edit_wiki_post site setting to edit_wiki_post_allowed_groups.

See: https://meta.discourse.org/t/283408

Hides the old setting
Adds the new site setting
Add a deprecation warning
Updates to use the new setting
Adds a migration to fill in the new setting if the old setting was changed
Adds an entry to the site_setting.keywords section
Updates tests to account for the new change
After a couple of months, we will remove the email_in_min_trust setting entirely.

Internal ref: /t/117248
2023-12-12 15:20:37 +11:00
Jarek Radosz
5140caf0e4
DEV: Update actions/labeler to v5 (#24835) 2023-12-12 09:27:58 +08:00
Tobias Eigen
653073bb24
update desc of top_page_default_timeframe (#24755)
Update to top_page_default_timeframe description to clarify how the setting works. It adjusts automatically for logged in users depending on their last visit.
2023-12-11 16:44:20 -08:00
David Taylor
a1cf426e27
DEV: Add ember-5 to test matrix for official plugins and themes (#24571)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-12-11 22:58:36 +01:00
dependabot[bot]
f1969c24c6
Build(deps): Bump the babel group in /app/assets/javascripts with 2 updates (#24833)
* Build(deps): Bump the babel group

Bumps the babel group in /app/assets/javascripts with 2 updates: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) and [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.23.5 to 7.23.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.6/packages/babel-core)

Updates `@babel/standalone` from 7.23.5 to 7.23.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.6/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: babel
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: babel
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-11 22:50:33 +01:00
dependabot[bot]
dac8187120
Build(deps-dev): Bump rubocop from 1.58.0 to 1.59.0 (#24834)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.58.0 to 1.59.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.58.0...v1.59.0)

---
updated-dependencies:
- dependency-name: rubocop
  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>
2023-12-11 22:44:51 +01:00
Jarek Radosz
3999f3e826
DEV: Convert PreferenceCheckbox to gjs (#24817) 2023-12-11 22:03:03 +01:00
Mark VanLandingham
c6a2c80441
UX: Adjust notification items when avatar is shown (#24832) 2023-12-11 14:44:14 -06:00
Jeff Wong
4e8f9e8fd2
DEV: remove animating class (#24830)
class is no longer needed to detect animations since the change in:

c2295b9d5d
2023-12-11 11:55:14 -08:00
David Taylor
598961086c
FIX: Correct and improve autohighlight_all_code setting description (#24828)
We allow HTML in site setting descriptions, so `<code>` was being rendered as HTML instead of text. This commit fixes that, and adds an additional sentence about how to control markdown-authored code blocks.
2023-12-11 18:29:05 +00:00
David Taylor
683c038ec0 UX: Add some missing hljs classes 2023-12-11 18:11:27 +00:00
David Taylor
a48595ae7a DEV: Remove unused hljs css selectors
In modern hljs, languages should be targetted with `lang-` prefixes. These selectors haven't worked in Discourse for a long time, so let's drop them to reduce confusion
2023-12-11 18:11:27 +00:00
Mark VanLandingham
6fc992f66a
FIX: Color of notification icons in user-notifications index (#24826) 2023-12-11 11:35:02 -06:00
Osama Sayegh
102e1b4faf
DEV: Remove legacy hamburger menu code (#24788)
We no longer offer the option to use the legacy hamburger menu since October 9th 2023, see 832b3b9e60. However, the code for the legacy hamburger menu is still around and needs to be removed. All plugins and themes that we know of that customize the legacy hamburger menu have been updated to either remove the customizations or migrate the customizations to the new sidebar, so now we can safely remove the legacy hamburger menu code from core.

Internal topic: t/113137.
2023-12-11 20:17:00 +03:00
Mark VanLandingham
223e413a6c
DEV: Render glimmer notification items for user notification list (#24802)
This removes the widget notifications list and renders the glimmer user menu notification items instead.
2023-12-11 11:04:43 -06:00
Jan Cernik
4904c2f11b
DEV: Skip chat transcript spec (#24819) 2023-12-11 13:09:22 -03:00
Penar Musaraj
695ec99cea
UX: Fix highlighting regressions (#24825)
Two regressions fixed here, one introduced in 6dc5fe0c83
and the other introduced a few months ago.
2023-12-11 11:02:48 -05:00
Bianca Nenciu
81b0420614
FEATURE: Add pagination to categories page (#23976)
When `lazy_load_categories` is enabled, the categories are no longer
preloaded in the `Site` object, but instead they are being requested
on a need basis.

The categories page still loaded all categories at once, which was not
ideal for sites with many categories because ti would take a lot of
time to build and parse the response.

This commit adds pagination to the categories page using the LoadMore
helper. As the user scrolls through the categories page, more categories
are requested from the server and appended to the page.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-12-11 17:58:45 +02:00
Penar Musaraj
af23fec835
FIX: Reload page after adding 2FA when it is enforced (#24803)
When 2FA is enforced and the user has no key or TOTP on their account, we
block navigating away from the page until they have added one. However,
we don't reload the page after they have added one, so the user is left
with a page that still says they need to add 2FA.
2023-12-11 10:56:30 -05:00
David Taylor
b5fb8e89eb
FIX: Resolve computed property override when inviting to PM (#24823)
This was raising a deprecation under Ember 3, and an error under Ember 4+
2023-12-11 15:39:50 +00:00
Joffrey JAFFEUX
dacb06842e
FIX: allow to click on thread indicator (#24821)
We can also now control tabindex, and other html attributes, which allows to lick on the thread indicator but not tab to it for example.

By default the tabindex will be 0.
2023-12-11 16:35:29 +01:00
Joffrey JAFFEUX
a7a4aaa6b9
FIX: ensures side panel is closed (#24822)
When navigating to /chat/threads we were not closing the side panel. It would not show as the route doesn't support it, but after if we would open a channel from the sidebar it would open the channel with an empty opened sidepanel .
2023-12-11 16:35:18 +01:00
Gerhard Schlager
dc8c6b8958 DEV: Lots of improvements to the generic_bulk import script
Notable changes:
* Imports a lot more tables from core and plugins
  * site settings
  * uploads with necessary upload references
  * groups and group members
  * user profiles
  * user options
  * user fields & values
  * muted users
  * user notes (plugin)
  * user followers (plugin)
  * user avatars
  * tag groups and tags
  * tag users (notification settings for tags / user)
  * category permissions
  * polls with options and votes
  * post votes (plugin)
  * solutions (plugin)
  * gamification scores (plugin)
  * events (plugin)
  * badges and badge groupings
  * user badges
  * optimized images
  * topic users (notification settings for topics)
  * post custom fields
  * permalinks and permalink normalizations

* It creates the `migration_mappings` table which is used to store the mapping for a handful of imported tables

* Detects duplicate group names and renames them

* Pre-cooking for attachments, images and mentions

* Outputs instructions when gems are missing

* Supports importing uploads from a DB generated by `uploads_importer.rb`

* Checks that all required plugins exists and enables them if needed

* A couple of optimizations and additions in `import.rake`
2023-12-11 16:23:07 +01:00
Gerhard Schlager
d725b3ca9e DEV: Add script for preprocessing uploads as part of a migration
This script preprocesses all uploads within a intermediate DB (output of converters) and uploads those files to S3. It does the same for optimized images. This speeds up migrations when you have to run them multiple times, because you only have to preprocess and upload the files once.

This script is very hacky and mostly undocumented for now. That will change in the future.
2023-12-11 16:23:07 +01:00
Gerhard Schlager
1cb600270e DEV: Convert dependencies of generic import script into optional gem group 2023-12-11 16:23:07 +01:00