Commit Graph

15588 Commits

Author SHA1 Message Date
Daniel Lockyer
bf45ef4a87 Cleaned up DB connection fallback in migrations commands
- throughout the migration utils we use the passed in DB connection or
  fallback to the `db.knex` instance
- this works, but it means we have places we need to make sure to
  implement `(transaction || db.knex)` everywhere
- as I'm working on refactoring the utils, this was also causing
  problems because I'd be checking the `transaction` instance but that may
  be null/undefined
- this commit pulls the fallback into the function parameters where it's
  evaluated at runtime
- this also has the added benefit that we get jsdoc typing now because
  the types are easy to figure out
- note: `transaction` should probably be renamed to `connection` because
  it's not necessary a transaction... but baby steps 🤓
2022-03-02 13:27:21 +01:00
Daniel Lockyer
11f64e91c0
Added extra handling for errors when adding foreign key
- this section of code handles the errors that arise when we add a
  foreign key to a table
- locally, I get different errors than the one listed - `ER_FK_DUP_KEY`
  and `ER_FK_DUP_NAME`
- I've been trying to find a good source for what each code is but it
  looks highly likely to be differences in DB engines
- we should probably handle these errors anyway because we don't want
  migrations to error out
2022-03-02 12:37:39 +01:00
Naz
1cc38733ba Added Media and Files APIs to API key allowlist
refs https://github.com/TryGhost/Toolbox/issues/219

- These two APIs similarly to Images API should be accessible by the Admin-API SDK. Opens up a way to write custom scripts uploading files and media
2022-03-02 16:33:56 +07:00
renovate[bot]
fbb23f4e66
Update dependency @tryghost/members-ssr to v1.0.22 (#14234)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-02 11:33:49 +02:00
renovate[bot]
457623dc8c
Update dependency @tryghost/members-api to v5.0.4 (#14231)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-02 11:33:30 +02:00
Renovate Bot
83af4795e2 Update actions/checkout action to v3 2022-03-02 08:06:56 +01:00
Renovate Bot
11ce137571 Update dependency cssnano to v5.1.0 2022-03-02 08:06:14 +01:00
Fabien 'egg' O'Carroll
db202fb162
Added visible column to products table (#14221)
refs https://github.com/TryGhost/Team/issues/1387

We are moving away from the portal_products setting to instead store
each tiers visiblity on the tier itself. This column will be used for
that data.

Both of the default Tiers should be visible, but newly created tiers
should not be.
2022-03-01 18:11:59 +02:00
Naz
b3bf19e9e3 Renamed e2e framework date matchers
refs f48892028d
refs 33da584161

- There was another mather added recently: anyDateWithTimezoneOffset. The naming of date-related matchers was getting long and confusing. Renamed existing date matcher to better reflect what they do and they types of matches they are responsible for, following renames have been done:
- anyShortDate  -> anyISODate
- anyDate  -> anyISODateTime
- anyDateWithTimezoneOffset  -> anyISODateTimeWithTZ
2022-03-01 18:17:13 +07:00
Renovate Bot
a17ef130f9 Update dependency @tryghost/validator to v0.1.14 2022-03-01 08:32:27 +01:00
Renovate Bot
54f8f46194 Update dependency @tryghost/root-utils to v0.3.11 2022-03-01 08:32:13 +01:00
Renovate Bot
d87a8f1a6e Update actions/setup-node action to v3 2022-03-01 08:31:42 +01:00
Renovate Bot
8e48991e7d Update dependency @playwright/test to v1.19.2 2022-03-01 08:31:33 +01:00
Renovate Bot
b803aa1d8c Update dependency postcss to v8.4.7 2022-03-01 08:31:21 +01:00
Renovate Bot
121e76b0d5
Update dependency @sentry/node to v6.18.1 2022-02-28 17:54:56 +00:00
Naz
b9e26c836b 🐛 Fixed missing index page from pages sitemaps
closes https://github.com/TryGhost/Ghost/issues/14180
refs 597ec51afb

- The index page `/` was missing from sitemaps.xml. It was a regression instoruced with a referenced commit.
2022-02-28 22:23:11 +07:00
Renovate Bot
f9fccc43a2 Update dependency eslint to v8.10.0 2022-02-28 12:28:44 +00:00
Rishabh
3c0306822f Added include as a valid option for members browse api
refs https://github.com/TryGhost/Team/issues/1029

- members browse endpoint didn't have `include` in its option list, so `?include...` was ignored in the api
- endpoint always reverted to using default relations in output, so `product` was never attached even if added in `include`
2022-02-28 15:30:15 +05:30
Daniel Lockyer
6025cb8502 v4.37.0 2022-02-25 16:00:27 +00:00
Daniel Lockyer
0e447bcdbe Updated Admin to v4.37.0 2022-02-25 16:00:27 +00:00
Renovate Bot
d5400a5538
Update dependency @sentry/node to v6.18.0 2022-02-24 17:35:57 +00:00
Thibaut Patel
e262b09180 Enabled the last_seen_at flag in the legacy member tests
refs https://github.com/TryGhost/Team/issues/1393

- Added the `last_seen_at` property back in the api answers. The property was removed in ebab652919 without updating the member legacy snapshots
2022-02-24 17:41:38 +01:00
Aileen Nowak
de2e894c53 Don't require description to setup with title
refs https://github.com/TryGhost/Team/issues/1382

- PR feedback
- Self hosters don't have the option to add a site description when setting up
- Update the logic to continue with the settings setup, even when no description is given
2022-02-24 12:36:57 -04:00
Aileen Nowak
92d9029500 Added accentColor and description parameters to /authentication/setup route
refs https://github.com/TryGhost/Team/issues/1382

- Added two possible new setup values: `accentColor` and `description` to define the brand colour and site description on initial setup
- Updated tests to reflect those changes
- Only the params when passed and fall back to default site description
2022-02-24 12:36:57 -04:00
Thibaut Patel
ebab652919 Moved the last_seen_at api property behind a flag
refs https://github.com/TryGhost/Team/issues/1393

- Prevents any issue from reaching all Ghost users
2022-02-24 17:28:07 +01:00
Hannah Wolfe
3bd8e01495 Pinned coverage to current levels to prevent drops
- Updating our config to have `--check-coverage` enforces that the coverage meets a certain level.
- The default is 95 I believe, but our coverage is lower.
- I've set the levels to our current levels, so any drop below these numbers will cause the build to fail.
- I've also set the reporters to be text, html and cobertura so we always have a mini report, the full HTML files to navigate and cobertura for CI
- Cleaned up CI so we don't use the cov:unit command as we're now using codecov
- This also means we can remove the cov:unit command which was weird to use because it uses the last test run, which can be confusing
2022-02-24 09:56:06 +00:00
Renovate Bot
6d648487fc
Update dependency luxon to v2.3.1 2022-02-23 20:51:21 +00:00
Fabien 'egg' O'Carroll
694721cbea
Added /tiers API to Admin API (#14200)
refs https://github.com/TryGhost/Team/issues/1313

Rather than removing the /products API we're adding a /tiers API as
a first step towards renaming "products" to "tiers". The initial idea was
to alias the URL's but out API framework doesn't easily allow for this so
we've duplicated it instead.
2022-02-23 17:00:18 +02:00
Naz
33da584161 Converted pages e2e test to use test-framework
refs https://github.com/TryGhost/Toolbox/issues/215

- The conversion should serve as a reference test. Eventually the aim is to have all tests converted to use "utils/e2e-framework"  instead of previously used plethora of utils and whatnot
2022-02-24 00:47:09 +13:00
Naz
d6d064be71 Converted posts e2e test to use test-framework
refs https://github.com/TryGhost/Toolbox/issues/215

- The conversion should serve as a reference test. Eventually the aim is to have all tests converted to use "utils/e2e-framework"  instead of previously used plethora of utils and whatnot
2022-02-24 00:47:09 +13:00
Naz
1309a8144f Converted settings e2e test to use test-framework
refs https://github.com/TryGhost/Toolbox/issues/215

- The conversion should serve as a reference test. It was also a massive LoC drop when converting, felt almost criminal not to do it!
2022-02-24 00:47:09 +13:00
Naz
9f0545b133 Added anyDateWithTimezoneOffset matcher to e2e framework
refs https://github.com/TryGhost/Toolbox/issues/215
refs https://github.com/TryGhost/Ghost/issues/10065

- The dates in Content API are returned with UTC offset which does not play ball with existing "anyDate" matcher. Created a new matcher to underline the difference in date formatting between Content and Admin APIs
2022-02-23 17:11:00 +07:00
Naz
fa373e0956 Added ContentAPITestAgent
refs https://github.com/TryGhost/Toolbox/issues/215

- The ContentAPI needs it's own test agent, so we can write e2e tests.
- The main method mostly to be used by the test suites is "authenticate" - it add necessary authentication keys to the request. The agent is not authenticated by default because there are suites that need to test the "non authenticated" requests. Also, there's a need to have the default API key inserted from fixtures level before authenticating (it's not strictly necessary because the key is not dynamic, but I think coupling this point would be a bad move)
2022-02-23 17:08:56 +07:00
Renovate Bot
3c3ead8648
Update dependency fs-extra to v10.0.1 2022-02-22 19:57:01 +00:00
Thibaut Patel
664dfbeae8 Added the last_seen_at field to the member API answers
refs https://github.com/TryGhost/Team/issues/1389
2022-02-22 19:45:55 +01:00
Renovate Bot
af1d1abd1d Update dependency @tryghost/logging to v2.0.4 2022-02-22 12:24:23 +01:00
Renovate Bot
688c353030 Update dependency @tryghost/nodemailer to v0.3.13 2022-02-22 12:20:40 +01:00
Renovate Bot
a0d248d18e Update dependency @tryghost/debug to v0.1.13 2022-02-22 12:20:27 +01:00
Renovate Bot
0ca6318f20 Update dependency @tryghost/errors to v1.2.3 2022-02-22 12:20:16 +01:00
Renovate Bot
d88770cc32 Update dependency @tryghost/tpl to v0.1.12 2022-02-22 12:19:20 +01:00
Renovate Bot
0e7eb4acd9 Update dependency @tryghost/version to v0.1.11 2022-02-22 12:17:30 +01:00
Thibaut Patel
e7751fa279 Backfilled the members last_seen_at column
refs https://github.com/TryGhost/Team/issues/1305

- Skipped sqlite3 compatibility due to the lack of join support in update
- Uses a raw migration to improve performance
2022-02-22 12:16:36 +01:00
Kevin Ansfield
00195b5bc4 Merged v4.36.3 into main 2022-02-22 10:28:55 +00:00
Daniel Lockyer
8b8144a3b8 v4.36.3 2022-02-22 10:25:09 +00:00
Daniel Lockyer
7a9c80a771 Updated Admin to v4.36.3 2022-02-22 10:25:09 +00:00
Daniel Lockyer
fb7e6e8276
Added note about installing the E2E browsers
refs https://github.com/TryGhost/Toolbox/issues/207

- we need to suggest to install the supported browsers so Playwright can run tests
  against them
2022-02-22 10:20:40 +01:00
Naz
4757158054 Removed leftover @tryghost/jest-snapshot usage
refs fd0a3e80ae
refs https://github.com/TryGhost/Toolbox/issues/215

- This changes got lost and should have landed with referenced commit
2022-02-22 10:33:42 +07:00
Naz
fd0a3e80ae Removed @tryghost/jest-snapshot dependency
refs https://github.com/TryGhost/Toolbox/issues/215

- Ghost tests had difficulty running sometimes when the versions for jest-snapshot package did not match in Ghost and @tryghost/express-test
- This is the error that was showing up: `IncorrectUsageError: Unable to run snapshot tests, current test was not configured`
- The reason why snapshot tests were misconfigured was multiple instances of SnapshotManager, which broke the singleton pattern
- Having jest-snapshot embeded within express-test makes sure the versions stay the same across the clients
- The version bump also introduces passing "queryParams" parameter into the Agent constructor - enables configuring query parameters that would appear in each agent's request. Example usecase - Content API authentication parameter "key" would be nice to "remember" and add to every request URL
2022-02-22 09:41:58 +07:00
Renovate Bot
63762afc49
Update dependency express-jwt to v6.1.1 2022-02-21 17:23:30 +00:00
Djordje Vlaisavljevic
2c5643623d Added the "selectablePortalLinks" feature flag
refs https://github.com/TryGhost/Team/issues/1096
2022-02-21 16:46:15 +01:00