Skip to content

Commit

Permalink
Add basic es tests (#12)
Browse files Browse the repository at this point in the history
* Update dependency haml_lint to v0.49.2 (mastodon#26222)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix: Streaming server memory leak in HTTP EventSource cleanup (mastodon#26228)

* Swap debug statements in streaming server (mastodon#26231)

* Fix missing return values in streaming (mastodon#26233)

* Use original URL in preview if it redirects to 4xx page (mastodon#26200)

* Allow filtering for Chinese languages (mastodon#26066)

* Update README.md (mastodon#25435)

* Add end-to-end (system) tests (mastodon#25461)

* Rubocop fix: `Perfomance/UnfreezeString` (mastodon#26217)

* Update rubocop rules for linelength (mastodon#26190)

* Add coverage for `LanguageValidator` (mastodon#25593)

* Add coverage for `URLValidator` (mastodon#25591)

* Fix `RSpec/EmptyExampleGroup` cop (mastodon#24735)

* Profiling tools configuration improvement (mastodon#25383)

* Load `rspec-rails` gem in `test` + `development` (mastodon#25768)

* Ignore the brakeman `PermitAttributes` check (mastodon#25915)

* Fix public TL not indicating new toots when `onlyRemote` is enabled (mastodon#26247)

Signed-off-by: Plastikmensch <[email protected]>

* Remove obsolete backport from Rails 7 (mastodon#26254)

* Change aspect ratios on link previews in web UI (mastodon#26250)

* Fix `Importer::BaseImporter#clean_up!` not using proper primary key (mastodon#26269)

* Bump version to v4.1.6 (mastodon#26272)

* Do not normalize URL before fetching it (mastodon#26219)

* Change /api/v1/peers/search to be case-insensitive when using Elasticsearch (mastodon#26268)

* Change interaction modal input to disable browser spell-checking, capitalization and autocomplete (mastodon#26267)

* Fix AVIF attachments (mastodon#26264)

* Add List-Unsubscribe email header (mastodon#26085)

* Fix wrong border radius on link cards in web UI (mastodon#26287)

* Fix line clamp for link previews in web UI (mastodon#26286)

* Change design of role badges in web UI (mastodon#26281)

Co-authored-by: Claire <[email protected]>

* Fix request URL normalisation for bare domain and 8-bit characters (mastodon#26285)

* Refactor: replace whitelist_mode mentions with limited_federation_mode (mastodon#26252)

* change column link to add a better keyboard focus indicator (mastodon#26278)

* Fix crash in `tootctl status remove` and some old migrations (mastodon#26210)

* Add client-side timeout on resend confirmation button (mastodon#26300)

* Allow spaces around commas in ALLOWED_PRIVATE_ADDRESSES (mastodon#26297)

* Change indexing frequency from 5 minutes to 1 minute, add locks to schedulers (mastodon#26304)

* Add primary key to preview_cards_statuses join table (includes deduplication migration) (mastodon#25243)

* Add `GET /api/v1/instance/languages` to REST API (mastodon#24443)

Co-authored-by: Eugen Rochko <[email protected]>
Co-authored-by: Claire <[email protected]>

* Update dependency aws-sdk-s3 to v1.132.0 (mastodon#26227)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add alt text for preview card thumbnails (mastodon#26184)

* Update dependency rack to v2.2.8 (mastodon#26312)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency react-redux to v8.1.2 (mastodon#26314)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency test-prof to v1.2.2 (mastodon#26316)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency core-js to v3.32.0 (mastodon#26317)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency lograge to v0.13.0 (mastodon#26318)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Rename “read” database to “replica” for consistency (mastodon#26326)

* Update dependency selenium-webdriver to v4.10.0 (mastodon#26322)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency rack-attack to v6.7.0 (mastodon#26319)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add direct link to the Single-Sign On provider if there is only one sign up method available (mastodon#26083)

* Re-add StatsD support through the `nsa` gem (mastodon#26310)

* Change reblogs to be excluded from "Posts and replies" tab in web UI (mastodon#26302)

* Change design of hidden media overlay (again) in web UI (mastodon#26330)

* Fix incorrect model annotation for List#exclusive (mastodon#26313)

* Fix light theme select option for hashtags (mastodon#26311)

* Fix confirmation when closing media edition modal with unsaved changes (mastodon#26342)

* Change streaming `/metrics` to include additional metrics (mastodon#26299)

* Fix missing cached preview cards attributes (mastodon#26343)

* Fix report modal secondary buttons style (mastodon#26341)

* Change header of hashtag timelines in web UI (mastodon#26362)

* New Crowdin Translations (automated) (mastodon#26209)

Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Claire <[email protected]>

* Make mastodon-streaming systemd unit templated (mastodon#24751)

Co-authored-by: Emelia Smith <[email protected]>

* Spec media attachment speedups (mastodon#25416)

* Fix interaction modal layout (mastodon#26368)

* Fix list import concurrently creating lists of the same name (mastodon#26372)

* Omniauth 2.0 version bump (mastodon#24209)

* Change account search tokenizer and queries (mastodon#26378)

* Fix adding column with default value taking longer on Postgres >= 11 (mastodon#26375)

* Fix `preview_cards_statuses_pkey` not being reindexed concurrently (mastodon#26384)

* Change `DB_REPLICA_*` environment variables to `REPLICA_DB_*` (mastodon#26386)

* Fix Content Security Policy sometimes unnecessarily allowing hCaptcha scripts (mastodon#26388)

* Prepare v4.2.0-beta1 (mastodon#26339)

* Fix blocking subdomains of an already-blocked domain (mastodon#26392)

* Use migration classes in migrations where current definition conflicts with older (mastodon#26390)

* Restore console behavior in `test` env (mastodon#26401)

* Change: Block GPTBot (mastodon#26396)

* Avoid connecting to a running ES instance in ES search check spec (mastodon#26413)

* Change the hashtag column to not display the hashtag header on pinned columns (mastodon#26416)

* Update dependency sass to v1.64.2 (mastodon#26315)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update eslint (non-major) (mastodon#26323)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* New Crowdin Translations (automated) (mastodon#26373)

Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Claire <[email protected]>

* Update dependency aws-sdk-s3 to v1.132.1 (mastodon#26423)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency immutable to v4.3.2 (mastodon#26425)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency haml_lint to v0.49.3 (mastodon#26424)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency eslint-config-prettier to v9 (mastodon#26434)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency sass to v1.65.1 (mastodon#26433)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency mime-types to '~> 3.5.0' (mastodon#26431)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency regenerator-runtime to ^0.14.0 (mastodon#26432)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency rails to v7.0.7 (mastodon#26428)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @rails/ujs to v7.0.7 (mastodon#26422)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency pg to v8.11.2 (mastodon#26426)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update babel monorepo to v7.22.10 (mastodon#26421)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency eslint-import-resolver-typescript to v3.6.0 (mastodon#26429)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency pg-connection-string to v2.6.2 (mastodon#26427)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add `S3_DISABLE_CHECKSUM_MODE` environment variable for compatibility with some S3-compatible providers (mastodon#26435)

* Merge duplicate Gemfile groups (mastodon#26441)

* Upgrade JS dev dependencies (mastodon#26442)

* Fix reply not preserving the language from the replied-to post (mastodon#26452)

* Add missing instances option to tootctl search deploy (mastodon#26461)

* Remove old non-unique index on preview_cards statuses join table (mastodon#26447)

* Upgrade `@types/react` (mastodon#26457)

* Fix "Create Account" button in interaction modal (mastodon#26459)

* Improve Renovate configuration (mastodon#26306)

* Update dependency faker to v3.2.1 (mastodon#26474)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency autoprefixer to v10.4.15 (mastodon#26473)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency nokogiri to v1.15.4 (mastodon#26476)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix `lint:json` not processing `json5` extension (mastodon#26481)

* New Crowdin Translations (automated) (mastodon#26444)

Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Claire <[email protected]>

* Add `ES_PRESET` option to customize numbers of shards and replicas (mastodon#26483)

Co-authored-by: Eugen Rochko <[email protected]>

* Fix `repo:changelog` task matching strings that are not Pull Request identifiers (mastodon#26280)

* Add privacy tab in profile settings (mastodon#26484)

Co-authored-by: Eugen Rochko <[email protected]>

* Add support for `indexable` attribute on remote actors (mastodon#26485)

Co-authored-by: Eugen Rochko <[email protected]>

* Fix ES_PRESET not being applied to Chewy's internal index (mastodon#26489)

* Fix unfollow icon styling in advanced column (mastodon#26482)

* Add display of out-of-band hashtags in the web interface (mastodon#26492)

Co-authored-by: Eugen Rochko <[email protected]>

* Fix hashtag bar display when status is in a thread (mastodon#26497)

* Update dependency postcss to v8.4.28 (mastodon#26502)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix hashtag bar sometimes including tags that appear in the post's body (mastodon#26506)

* Fix “legal” report category not showing up in moderation interface (mastodon#26509)

* Change “privacy and reach” settings so that unchecking boxes always increase privacy and checking them always increase reach (mastodon#26508)

* Fix case-insensitive comparison of hashtags to do case-folding (mastodon#26525)

* Fix cached posts including stale stats (mastodon#26409)

* Update dependency pg to v8.11.3 (mastodon#26519)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Allow setting a custom HTTP method in CacheBuster (mastodon#26528)

Co-authored-by: Jorijn Schrijvershof <[email protected]>

* Fix `frame_rate` for videos where `ffprobe` reports 0/0 (mastodon#26500)

* Update dependency puma to v6.3.1 (mastodon#26537)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @material-design-icons/svg to v0.14.11 (mastodon#26536)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Remove redundant ready() wrapper (mastodon#26533)

* Fix: support both DATABASE_URL and DB_PASS (mastodon#26295)

* Fix already initialized constant warning (mastodon#26542)

* Change follow recommendation materialized view to be faster in most cases (mastodon#26545)

Co-authored-by: Renaud Chaput <[email protected]>

* Fix profile picture preview (mastodon#26538)

* Add ability to delete avatar or header picture via the API (mastodon#25124)

Co-authored-by: Claire <[email protected]>

* Do not start LibreTranslate and Elasticsearch on GitHub Codespaces (mastodon#26382)

* Update dependency core-js to v3.32.1 (mastodon#26548)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update eslint (non-major) (mastodon#26567)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Refactor `Api::V1::ProfilesController` into two separate controllers (mastodon#26573)

* Add auto-refresh of accounts we get new messages/edits of (mastodon#26510)

* Add Elasticsearch cluster health check and indexes mismatch check to dashboard (mastodon#26448)

* Remove hashtags from the last line of a status if it only contains hashtags (mastodon#26499)

* Bump version to v4.2.0-beta2 (mastodon#26579)

* Fix layout of the closed registrations modal (mastodon#26593)

* Update rubocop and rubocop-rspec (mastodon#26329)

* Add `circular-dependency-plugin` to detect any circular deps issues (mastodon#26600)

* Update `SECURITY.md` to indicate issues can be reported on Github (mastodon#26599)

* Update dependency mime-types to v3.5.1 (mastodon#26595)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add cherokee to languages dropdown (mastodon#26012)

* Add Kalmyk to languages dropdown (mastodon#26013)

* Fix admin dashboard check when using Elasticsearch with `ES_PREFIX` (mastodon#26605)

* Better hashtag normalization when processing a post (mastodon#26614)

* Update dependency rails to v7.0.7.2 (mastodon#26612)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency react-textarea-autosize to v8.5.3 (mastodon#26607)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add support for federating `memorial` attribute  (mastodon#26583)

* Fix unexpected audio stream transcoding when uploaded video is eligible to passthrough (mastodon#26608)

Co-authored-by: Claire <[email protected]>

* Update Account Search to prioritize username over display name (mastodon#26623)

* Change the hashtag bar to be hidden when there is a CW and the post is not expanded (mastodon#26615)

* Fix some React warnings (mastodon#26609)

* Change hashtag bar tags to be de-emphasized (mastodon#26606)

* Update dependency immutable to v4.3.3 (mastodon#26622)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency oj to v3.16.0 (mastodon#26520)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency sass to v1.66.1 (mastodon#26534)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add elastic search installation into Vagrantfile (mastodon#26512)

* Fix timeout on invalid set of exclusionary parameters in `/api/v1/timelines/public` (mastodon#26239)

* Change opacity of the delete icon in the search field to be more visible (mastodon#26449)

* Update dependency rspec-sidekiq to v4 (mastodon#26627)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Consolidate inclusion of `admin` js pack link (mastodon#26628)

* Update dependency redis to v4.6.8 (mastodon#26630)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix: Workaround to load MASTODON_VERSION_* in Docker. (mastodon#26591)

Co-authored-by: Claire <[email protected]>

* Fix selecting domains to forward reports to not passing the information correctly (mastodon#26636)

* Fix clicking “Explore” or “Live feeds” column headers to scroll in advanced mode (mastodon#26633)

Co-authored-by: Plastikmensch <[email protected]>

* Change admin e-mail notification settins to be their own settings group (mastodon#26596)

* Change nightlies versioning from `v4.2.0+2023-08-23` to `v4.2.0-nightly.2023-08-23` (mastodon#26626)

* Add new public status index (mastodon#26344)

Co-authored-by: Eugen Rochko <[email protected]>
Co-authored-by: Claire <[email protected]>

* Fix changelog wording and missing items (mastodon#26638)

* Update babel monorepo to v7.22.11 (mastodon#26640)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add `data-nosnippet` attribute to remote posts and local posts with `noindex` (mastodon#26648)

* Add PublicStatusesCheck to Elasticsearch index check on admin dashboard (mastodon#26650)

* Add Elasticsearch/OpenSearch version to “Software” in admin dashboard (mastodon#26652)

* Fix statuses search Elasticsearch query (mastodon#26657)

* Update dependency immutable to v4.3.4 (mastodon#26655)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update ordering to use `id` from body of document instead of deprecated `_id` (mastodon#26659)

* Fix dashboard check for Elasticsearch suggested command including incorrect names (mastodon#26658)

* Change the pre-release versioning scheme and associated environment variables (mastodon#26653)

* Fix toast saying "published" instead of "saved" after editing post in web UI (mastodon#26664)

* Fix nightly build version (mastodon#26676)

* Change queue of job when opting into search from `default` to `pull` (mastodon#26688)

* Fix unnecessary condition causing seqscan when indexing (mastodon#26689)

* Change indexing jobs to use database replica (mastodon#26692)

* Update eslint (non-major) (mastodon#26694)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix not being able to negate prefix clauses in search (mastodon#26672)

* Update dependency haml_lint to v0.50.0 (mastodon#26665)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update DefinitelyTyped types (non-major) (mastodon#26693)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix multiple issues with status index mappings (mastodon#26686)

* Update dependency @testing-library/jest-dom to v6 (mastodon#26479)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <[email protected]>

* Add `from:me` syntax to search (mastodon#26660)

* Add search options to search popout in web UI (mastodon#26662)

* Fix incorrect call to `PublicStatusesIndex.import` (mastodon#26697)

* A first pass at adding some basic ES tests

* Add more tests

---------

Signed-off-by: Plastikmensch <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Emelia Smith <[email protected]>
Co-authored-by: Claire <[email protected]>
Co-authored-by: Renaud Chaput <[email protected]>
Co-authored-by: Christian Schmidt <[email protected]>
Co-authored-by: gunchleoc <[email protected]>
Co-authored-by: Jay Prakash Kalia <[email protected]>
Co-authored-by: Matt Jankowski <[email protected]>
Co-authored-by: Plastikmensch <[email protected]>
Co-authored-by: Eugen Rochko <[email protected]>
Co-authored-by: Trevor Wolf <[email protected]>
Co-authored-by: Val Lorentz <[email protected]>
Co-authored-by: Daniel M Brasil <[email protected]>
Co-authored-by: CSDUMMI <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Eashwar Ranganathan <[email protected]>
Co-authored-by: Foritus <[email protected]>
Co-authored-by: Nick Schonning <[email protected]>
Co-authored-by: Jeong Arm <[email protected]>
Co-authored-by: mogaminsk <[email protected]>
Co-authored-by: HonkingGoose <[email protected]>
Co-authored-by: Santiago Kozak <[email protected]>
Co-authored-by: Jorijn Schrijvershof <[email protected]>
Co-authored-by: Nicolai Søborg <[email protected]>
Co-authored-by: Robert R George <[email protected]>
Co-authored-by: yufushiro <[email protected]>
Co-authored-by: Antonin Del Fabbro <[email protected]>
Co-authored-by: Jaehong Kang <[email protected]>
  • Loading branch information
1 parent b7d4c84 commit 02c4a11
Show file tree
Hide file tree
Showing 553 changed files with 8,571 additions and 5,043 deletions.
3 changes: 0 additions & 3 deletions .bundler-audit.yml

This file was deleted.

16 changes: 7 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "Mastodon",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/sshd:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or the host.
"runServices": ["app", "db", "redis"],

"forwardPorts": [3000, 4000],

// Use 'postCreateCommand' to run commands after the container is created.
"containerEnv": {
"ES_ENABLED": "",
"LIBRE_TRANSLATE_ENDPOINT": ""
},

"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postCreateCommand": ".devcontainer/post-create.sh",
"waitFor": "postCreateCommand",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["EditorConfig.EditorConfig", "webben.browserslist"]
}
}
Expand Down
29 changes: 15 additions & 14 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:base',
':dependencyDashboard',
'config:recommended',
':labels(dependencies)',
':maintainLockFilesMonthly', // update non-direct dependencies monthly
':prConcurrentLimit10', // only 10 open PRs at the same time
':prConcurrentLimitNone', // Remove limit for open PRs at any time.
':prHourlyLimit2', // Rate limit PR creation to a maximum of two per hour.
],
stabilityDays: 3, // Wait 3 days after the package has been published before upgrading it
minimumReleaseAge: '3', // Wait 3 days after the package has been published before upgrading it
// packageRules order is important, they are applied from top to bottom and are merged,
// meaning the most important ones must be at the bottom, for example grouping rules
// If we do not want a package to be grouped with others, we need to set its groupName
// to `null` after any other rule set it to something.
dependencyDashboardHeader: 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. Before approving any upgrade: read the description and comments in the [`renovate.json5` file](https://github.com/mastodon/mastodon/blob/main/.github/renovate.json5).',
packageRules: [
{
// Ignore major version bumps for these node packages
// Require Dependency Dashboard Approval for major version bumps of these node packages
matchManagers: ['npm'],
matchPackageNames: [
'tesseract.js', // Requires code changes
Expand All @@ -41,10 +42,10 @@
'react-router-dom',
],
matchUpdateTypes: ['major'],
enabled: false,
dependencyDashboardApproval: true,
},
{
// Ignore major version bumps for these Ruby packages
// Require Dependency Dashboard Approval for major version bumps of these Ruby packages
matchManagers: ['bundler'],
matchPackageNames: [
'rack', // Needs to be synced with Rails version
Expand All @@ -55,33 +56,33 @@
'redis', // Requires manual upgrade and sync with Sidekiq version
],
matchUpdateTypes: ['major'],
enabled: false,
dependencyDashboardApproval: true,
},
{
// Update Github Actions and Docker images weekly
matchManagers: ['github-actions', 'dockerfile', 'docker-compose'],
extends: ['schedule:weekly'],
},
{
// Ignore major & minor bumps for the ruby image, this needs to be synced with .ruby-version
// Require Dependency Dashboard Approval for major & minor bumps for the ruby image, this needs to be synced with .ruby-version
matchManagers: ['dockerfile'],
matchPackageNames: ['moritzheiber/ruby-jemalloc'],
matchUpdateTypes: ['minor', 'major'],
enabled: false,
dependencyDashboardApproval: true,
},
{
// Ignore major bump for the node image, this needs to be synced with .nvmrc
// Require Dependency Dashboard Approval for major bumps for the node image, this needs to be synced with .nvmrc
matchManagers: ['dockerfile'],
matchPackageNames: ['node'],
matchUpdateTypes: ['major'],
enabled: false,
dependencyDashboardApproval: true,
},
{
// Ignore major postgres bumps in the docker-compose file, as those break dev environments
// Require Dependency Dashboard Approval for major postgres bumps in the docker-compose file, as those break dev environments
matchManagers: ['docker-compose'],
matchPackageNames: ['postgres'],
matchUpdateTypes: ['major'],
enabled: false,
dependencyDashboardApproval: true,
},
{
// Update devDependencies every week, with one grouped PR
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
type: boolean
push_to_images:
type: string
version_suffix:
version_prerelease:
type: string
version_metadata:
type: string
flavor:
type: string
Expand Down Expand Up @@ -83,7 +85,9 @@ jobs:
- uses: docker/build-push-action@v4
with:
context: .
build-args: MASTODON_VERSION_SUFFIX=${{ inputs.version_suffix }}
build-args: |
MASTODON_VERSION_PRERELEASE=${{ inputs.version_prerelease }}
MASTODON_VERSION_METADATA=${{ inputs.version_metadata }}
platforms: ${{ inputs.platforms }}
provenance: false
builder: ${{ steps.buildx.outputs.name || steps.buildx-native.outputs.name }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
env:
TZ: Etc/UTC
run: |
echo mastodon_version_suffix=nightly-$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT
echo mastodon_version_prerelease=nightly.$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT
outputs:
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }}
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}

build-image:
needs: compute-suffix
Expand All @@ -29,14 +29,13 @@ jobs:
push_to_images: |
tootsuite/mastodon
ghcr.io/mastodon/mastodon
# The `+` is important here, result will be v4.1.2+nightly-2022-03-05
version_suffix: +${{ needs.compute-suffix.outputs.suffix }}
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes
flavor: |
latest=auto
tags: |
type=raw,value=edge
type=raw,value=nightly
type=schedule,pattern=${{ needs.compute-suffix.outputs.suffix }}
type=schedule,pattern=${{ needs.compute-suffix.outputs.prerelease }}
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/build-push-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
uses: actions/checkout@v3
- id: version_vars
run: |
echo mastodon_version_suffix=+pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
echo mastodon_version_metadata=pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
outputs:
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }}
metadata: ${{ steps.version_vars.outputs.mastodon_version_metadata }}

build-image:
needs: compute-suffix
Expand All @@ -33,7 +33,7 @@ jobs:
use_native_arm64_builder: true
push_to_images: |
ghcr.io/mastodon/mastodon
version_suffix: ${{ needs.compute-suffix.outputs.suffix }}
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
flavor: |
latest=auto
tags: |
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,100 @@ jobs:
run: './bin/rails db:create db:schema:load db:seed'

- run: bundle exec rake rspec_chunked

test-e2e:
name: End to End testing
runs-on: ubuntu-latest

needs:
- build

services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

env:
DB_HOST: localhost
DB_USER: postgres
DB_PASS: postgres
DISABLE_SIMPLECOV: true
RAILS_ENV: test
BUNDLE_WITH: test

strategy:
fail-fast: false
matrix:
ruby-version:
- '3.0'
- '3.1'
- '.ruby-version'

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
path: './public'
name: ${{ github.sha }}

- name: Update package index
run: sudo apt-get update

- name: Set up Node.js
uses: actions/setup-node@v3
with:
cache: yarn
node-version-file: '.nvmrc'

- name: Install native Ruby dependencies
run: sudo apt-get install -y libicu-dev libidn11-dev

- name: Install additional system dependencies
run: sudo apt-get install -y ffmpeg imagemagick

- name: Set up bundler cache
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version}}
bundler-cache: true

- run: yarn --frozen-lockfile

- name: Load database schema
run: './bin/rails db:create db:schema:load db:seed'

- run: bundle exec rake spec:system

- name: Archive logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: e2e-logs-${{ matrix.ruby-version }}
path: log/

- name: Archive test screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: e2e-screenshots
path: tmp/screenshots/
9 changes: 1 addition & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ Layout/FirstHashElementIndentation:
# Reason: Currently disabled in .rubocop_todo.yml
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinelength
Layout/LineLength:
AllowedPatterns:
# Allow comments to be long lines
- !ruby/regexp / \# .*$/
- !ruby/regexp /^\# .*$/
Exclude:
- 'lib/mastodon/cli/*.rb'
- db/*migrate/**/*
- db/seeds/**/*
Max: 320 # Default of 120 causes a duplicate entry in generated todo file

# Reason:
# https://docs.rubocop.org/rubocop/cops_lint.html#lintuselessaccessmodifier
Expand Down
Loading

0 comments on commit 02c4a11

Please sign in to comment.