Commit Graph

515 Commits

Author SHA1 Message Date
renovate[bot]
b754513658 Update jaegertracing/all-in-one Docker tag to v1.58 2024-06-21 09:38:38 +01:00
Chris Raible
417c9c49ea
Added OpenTelemetry instrumentation to Ghost backend (#20144)
This commit adds OpenTelemetry instrumentation to Ghost's backend, which
allows us to view traces similar to what we see in Sentry Performance
locally.

OpenTelemetry is enabled if `NODE_ENV === 'development'` or if it is
explicitly enabled via config with `opentelemetry:enabled`.

It also adds a [Jaeger](https://www.jaegertracing.io/) container to
Ghost's docker-compose file for viewing the traces. There's no setup
required (beyond running `yarn docker:reset` to pickup the changes in
the docker-compose file the first time — but this will also reset your
DB so be careful). This will launch the Jaeger container, and you can
view the UI to see the traces at `http://localhost:16686/search`.
2024-06-19 13:56:51 -07:00
renovate[bot]
54bd9a1ab4 Update benchmark-action/github-action-benchmark action to v1.20.3 2024-05-20 10:39:02 +01:00
renovate[bot]
15569145f3 Update benchmark-action/github-action-benchmark action to v1.20.1 2024-05-09 10:23:48 +02:00
Michael Barrett
af92297ca9
Added Redis via Docker (#20085)
no refs

Redis can be utilised for various caching purposes within Ghost. This PR
adds a Redis service to the docker-compose file to allow for easier
local development when Redis is required
2024-05-07 11:02:36 +01:00
Joe Grigg
c744740761 Updated canary build CI to use the main Moya build pipeline
ref ENG-807
2024-05-01 13:22:01 +01:00
Djordje Vlaisavljevic
7a3bbfde10
Added ActivityPub playground (#20081)
ref MOM61

- Adds admin-x react app we’ll use as ActivityPub playground to the
sidebar nav behind the feature flag.
- Wired up routing to Ember
- Setup the project as `admin-x-activitypub`

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-04-25 16:44:29 +08:00
Daniel Lockyer
10e81aeed8
ℹ️ Added support for Node 20
ref https://linear.app/tryghost/issue/ENG-765/add-support-for-node-20

- this adds support for Node 20 to Ghost and CI, as Node 20 is an LTS
  version and we should pick it up
2024-04-18 13:17:21 +02:00
renovate[bot]
e8ea2e4db0 Update GitHub Artifact Actions to v4 2024-04-18 12:36:39 +02:00
renovate[bot]
4ab31122a4 Update actions/cache action to v4 2024-04-18 12:36:07 +02:00
renovate[bot]
2d6a361bb5 Update dorny/paths-filter action to v2.12.0 2024-04-16 09:44:01 +02:00
Joe Grigg
d0c1814a1c Fixed incorrect branch for canary build
no-issue
2024-03-25 15:02:10 +00:00
Joe Grigg
7c5b8355e4 Switched canary build to use the new faster build pipeline
no-issue
2024-03-25 14:36:02 +00:00
Ronald Langeveld
bc7ff4be9c
Added no-seed flag to yarn setup. (#19697)
refs https://ghost.slack.com/archives/C02G9E68C/p1707994528206559

- When running Ghost development and using MySQL + Docker, you can run
the command `yarn setup --no-seed` to not have the database seeded with
test data.
2024-02-15 14:48:08 +02:00
Michael Barrett
47439b3b94
Updated docker-compose.yml to include a name for the project (#19588)
no refs

Added a name for the project in `docker-compose.yml` as it was using the
`scripts` directory as the name

Before:

```sh
❯ docker-compose ls
NAME                STATUS              CONFIG FILES
scripts             running(1)          /path/to/ghost/.github/scripts/docker-compose.yml
```

After:

```sh
❯ docker-compose ls
NAME                STATUS              CONFIG FILES
ghost               running(1)          /path/to/ghost/.github/scripts/docker-compose.yml
```
2024-02-01 09:06:44 +00:00
Sam Lord
167a442ffe Free ubuntu-latest machines now also have 4 cores
refs: https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/

This should still allow us to run tests in 8~ minutes without paying for the VM time
2024-01-18 09:35:30 +00:00
Simon Backx
ea7290c0da
Added xxl options to data generation (#19488)
no issue

Allows switching between 100k members vs 2M members
2024-01-16 10:20:33 +00:00
Simon Backx
d2cb23c3fa
Wired up Docker setup script and increased data generation performance (#19420)
ref PROD-233

- Stored whether Docker is used in the config files
- When running `yarn setup`, any existing Docker container will be
reset. Run with `-y` to skip the confirmation step.
- `yarn setup` will always init the database and generate fake data
- Increased amount of default generated data to 100,000 members + 500
posts.
- Made lots of performance improvements in the data generator so we can
generate the default data in ±170s
2024-01-05 13:42:30 +00:00
Simon Backx
eebf0e2eaf Added knex-migrator init to setup script
ref PROD-233

When clearing the Docker database container, you still need to be able to run `yarn setup` to create the tables.
2023-12-14 18:30:45 +01:00
Daniel Lockyer
b67176431b Removed manual list of Typescript projects from dev script
fixes https://github.com/TryGhost/DevOps/issues/122

- this introduces some code to get all the Typescript projects
  programatically instead of relying on developers to manually add their
  project to the list, which is clearly better
2023-12-13 13:18:11 +01:00
Daniel Lockyer
a9c9202b5c Added defaults to Nx build step
refs https://github.com/TryGhost/DevOps/issues/122

- this allows us to DRY up some of the other configuration we have
  dotted around and fixes a niche bug with overlapping builds that we
  were seeing before, because Nx should only allow one build at a time
2023-12-13 11:54:31 +01:00
Daniel Lockyer
d65a95836b Revert "Enabled app build artifact caching in CI"
This reverts commit 617d3a6ffc.
2023-12-11 15:32:46 +01:00
Daniel Lockyer
617d3a6ffc Enabled app build artifact caching in CI
fixes https://github.com/TryGhost/DevOps/issues/120

- we've seen errors in CI where the unit tests for the apps folder are
  being run concurrently, but the build assets are not present so
  multiple builds are happening for the same folder
- this leads to errors because Vite tries to cleanup or build folders
  at the same time
- this should fix that by eagerly building the apps and caching the
  output so unit tests run quicker
2023-12-11 12:28:27 +01:00
Daniel Lockyer
398f96249c Added MySQL setup via Docker
refs https://github.com/TryGhost/DevOps/issues/118

- we should standardize how we run MySQL, so there aren't massive gaps
  in developer experience
- Docker is great for this, and it's pretty easy to set up
- this adds a docker-compose.yml file with a small MySQL setup
- also configures `yarn setup` to spin up the Docker container and add
  it to config.local.json
- in the near future, we'll provide a base SQL file in .github/scripts/mysql-preload
  to ensure the DB is in a known state
2023-12-07 10:57:47 +01:00
Daniel Lockyer
d617891e46 Configured Nx watch to run in an infinite loop
refs https://ghost.slack.com/archives/C02G9E68C/p1701939292474999?thread_ts=1701881060.000299&cid=C02G9E68C

- when you change branch or do a `git pull`, Nx will kill the watch
  command
- this becomes annoying when you're doing local development because it
  tears down the whole `yarn dev` command
- this puts the nx watch command in an infinite loop so it's just
  restart again and concurrently doesn't detect it as a failure
2023-12-07 10:34:20 +01:00
Simon Backx
17ec1e8937
Added email address alignment protections (#19094)
ref GRO-54
fixes GRO-63
fixes GRO-62
fixes GRO-69

When the config `hostSettings:managedEmail:enabled` is enabled, or the
new flag (`newEmailAddresses`) is enabled for self-hosters, we'll start
to check the from addresses of all outgoing emails more strictly.

- Current flow: nothing changes if the managedEmail config is not set or
the `newEmailAddresses` feature flag is not set
- When managedEmail is enabled: never allow to send an email from any
chosen email. We always use `mail.from` for all outgoing emails. Custom
addresses should be set as replyTo instead. Changing the newsletter
sender_email is not allowed anymore (and ignored if it is set).
- When managedEmail is enabled with a custom sending domain: if a from
address doesn't match the sending domain, we'll default to mail.from and
use the original as a replyTo if appropriate and only when no other
replyTo was set. A newsletter sender email addresss can only be set to
an email address on this domain.
- When `newEmailAddresses` is enabled: self hosters are free to set all
email addresses to whatever they want, without verification. In addition
to that, we stop making up our own email addresses and send from
`mail.from` by default instead of generating a `noreply`+ `@` +
`sitedomain.com` address

A more in depth example of all cases can be seen in
`ghost/core/test/integration/services/email-addresses.test.js`

Includes lots of new E2E tests for most new situations. Apart from that,
all email snapshots are changed because the from and replyTo addresses
are now included in snapshots (so we can see unexpected changes in the
future).

Dropped test coverage requirement, because tests were failing coverage
locally, but not in CI

Fixed settings test that set the site title to an array - bug tracked in
GRO-68
2023-11-23 10:25:30 +01:00
Jono M
a93c665d20
Created a skeleton AdminX demo app (#19005)
refs https://github.com/TryGhost/Product/issues/4152

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at a28462f</samp>

This pull request adds a new admin-x app called `admin-x-demo`, which
demonstrates how to use the shared packages `admin-x-framework` and
`admin-x-design-system` to create a simple app that renders a button and
a modal. It also improves the development workflow, the vite
integration, the dependency management, and the type checking for the
admin-x apps and packages. It modifies some files in the
`admin-x-framework` and `admin-x-design-system` packages to make the
modals prop optional, to introduce a new type for the props from the
Ember app, to fix the z-index of the modal backdrop, and to use
consistent file extensions and module syntax.
2023-11-20 13:30:15 +00:00
Daniel Lockyer
6bc703e235 Fixed glob for Admin-X projects
refs c695497598

- the previous glob didn't match correctly
2023-11-20 12:49:34 +01:00
Daniel Lockyer
b1666f596f Removed GitHub Copilot for PRs templating value
refs https://githubnext.com/copilot-for-prs-sunset

- unfortunately the technical preview will end in mid December so we
  need to cleanup the templating var
2023-11-20 11:43:58 +01:00
Daniel Lockyer
c695497598 Switched to actions/labeler for PR labeling
fixes https://github.com/TryGhost/DevOps/issues/111

- this allows us to add labels based upon the contents in a smarter way
  than the previous workflow
2023-11-20 11:43:58 +01:00
Simon Backx
e3cdc24d6b
Added test to test default theme against linked gscan version (#19020)
fixes GRO-32

If we ever introduce errors in the linked source theme and linked gscan
version combination, this test will catch it.
2023-11-16 12:03:00 +00:00
Daniel Lockyer
e2be6dbf14 Configured submodules to clone in performance tests
refs https://github.com/TryGhost/DevOps/issues/105

- we should include submodules in the checkout so the Ghost boot is
  representative of booting Ghost with a theme
2023-11-15 14:08:32 +01:00
Daniel Lockyer
566f2055d0 Moved GitHub context logging to job
- this stops the entire context from being output in the env vars, so it
  cleans up the output at the top of each job
2023-11-15 13:54:20 +01:00
Daniel Lockyer
18afd39193 Removed NODE_ENV env var from perf tests
refs 05977d5c26

- this seems to break things, will investigate once this is merged
- also adds showing output flag so debugging is easier
2023-11-15 13:35:41 +01:00
Daniel Lockyer
05977d5c26 Added boot time performance test to CI
refs https://github.com/TryGhost/DevOps/issues/105

- this will run a small benchmark on the boot time for Ghost, and push
  the stats to another repository which has GitHub Pages enabled, so we
  can visualise the change over time
- will only run on pushes to `main` so we don't pollute the stats with
  commits from PRs
- just a test for now to see if we get stable numbers
2023-11-15 13:24:56 +01:00
Daniel Lockyer
199baacfd5 Improved error message for yarn dev
refs https://github.com/TryGhost/DevOps/issues/104

- added colors and better messages to help when the script fails
2023-11-15 10:34:34 +01:00
Daniel Lockyer
76672e3e15 Improved output from dev script
refs https://github.com/TryGhost/DevOps/issues/104

- added a single line outputting what projects we're running
- removed line for Stripe token fetching
2023-11-15 10:11:22 +01:00
Daniel Lockyer
54e1b6002d Switched to Nx for more project commands
refs https://github.com/TryGhost/DevOps/issues/104

- this should marginally speed things up because we don't have to go
  through `yarn`, which is notoriously slow
2023-11-15 10:11:22 +01:00
Jono M
94a181ce2a
Separated common AdminX logic into a reusable package (#18919)
refs https://github.com/TryGhost/Product/issues/4123

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at a420f0b</samp>

This pull request moves most of the API-related types and functions from
the `admin-x-settings` package to the `admin-x-framework` package, which
is a new library of common utilities and hooks for the admin-x apps. It
also adds some configuration files, such as `.eslintrc.cjs` and
`.gitignore`, to the `admin-x-framework` package. Additionally, it
exports the `FetchKoenigLexical` type from the `admin-x-design-system`
package, which is used by the `HtmlEditor` component.
2023-11-14 13:50:08 +00:00
Jono M
67251e6e1d
Renamed admin-x-design to admin-x-design-system for clarity (#18914)
refs https://github.com/TryGhost/Product/issues/4105
2023-11-08 15:10:43 +00:00
Jono M
048dac30ed
Extracted AdminX design system to a separate package (#18878)
refs https://github.com/TryGhost/Product/issues/4105

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 2edba98</samp>

This pull request introduces a new monorepo package called
`admin-x-design`, which contains components, design guidelines and
documentation for building apps in Ghost Admin. It also moves some
existing components and files from the deprecated `admin-x-settings`
package to the new `admin-x-design` package, and updates some styles and
rules to use TailwindCSS. The purpose of these changes is to improve the
consistency, maintainability and usability of the Ghost Admin UI.
2023-11-08 12:33:18 +00:00
renovate[bot]
3909de2f17 Update actions/setup-node action to v4 2023-11-08 13:29:13 +01:00
Daniel Lockyer
6900c1f2b3 Configured CI to run Ghost-CLI tests on Node 18
refs https://github.com/TryGhost/DevOps/issues/75

- this will install v4 using Node v16 and then switch to v18 as we're
  about to drop support for Node v16
2023-10-25 17:50:56 +02:00
Daniel Lockyer
f6dfe05c30 Added guard against non-code changes to run CI tests
- we don't want to run browser tests if no code has changed
2023-10-25 12:06:00 +02:00
Daniel Lockyer
c5c6f84c7d Added CI check to ensure i18n translations are in sync
fixes https://github.com/TryGhost/DevOps/issues/91

- this adds a CI job that will run i18n tests if any of the packages
  that use it have changed
- this helps prevent translations from going out of sync
2023-10-25 12:06:00 +02:00
John O'Nolan
67b6d7cd15
Added contributor code of conduct 2023-10-18 12:10:05 +02:00
Sam Lord
11b9e8a73f Switch to 4-core runners for browser tests
refs: https://github.com/TryGhost/DevOps/issues/78

This number of cores has been approved, will test with 1 browser per core, and 1 browser for every two cores
2023-10-17 12:40:19 +01:00
Daniel Lockyer
e699facc03 Cleaned path to Playwright reports
- this is cleaner and follows the pattern as other jobs do
2023-10-16 17:37:42 +02:00
Daniel Lockyer
18f55d6af0 Moved browser E2E tests into CI workflow
refs https://github.com/TryGhost/DevOps/issues/78

- this allows us to take advantage of the dependency caching and metadata
  workflows, to reduce the overall execution time and duplicate logic
2023-10-16 13:45:22 +02:00
Sam Lord
4815aa6e7f
Parallelise browser tests
refs: https://github.com/TryGhost/DevOps/issues/78

Re-introduce parallel browser tests

These were adding in a previous PR, but the difference between local
running tests and using CI introduced failures.

Added additional fixes to ensure the Stripe API key is used in the CLI when running in CI.
2023-10-13 11:42:39 +00:00