Commit Graph

172 Commits

Author SHA1 Message Date
6fc691beb0 [CI] Refactor composite action task-cache (#9583)
## Introduction
In this previous PR https://github.com/twentyhq/twenty/pull/9448 we've
refactored the storybook build caching flow to be using the new
[actions/cache](https://github.com/actions/cache) `restore` and `save`
functions, which significantly improve caching operations duration.

In this way, in this PR, we've standardize both of the `restore` and
`save` by refactoring the `task-cache` composite action. By creating two
new composite actions `save-cache` and `restore-cache` that centralize
the paths to cache and the way to compute the primary key.

## Misc
- **If no cache** is hit, then a job duration will long for its task
duration and nothing else, previously the cache upload would sometimes
take up to 3 mins.
- **if cache** is hit, then mainly the only time consuming step is the
dependencies installation ( which is theory is also cached, in fact
twice. We will be having a look on this issue in an upcoming PR )
2025-01-14 12:06:23 +01:00
c1847054f8 Playwright E2E test - sign up with invite link via email (#9332)
Related to
https://github.com/twentyhq/twenty/issues/8469#issuecomment-2471573054

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-01-12 21:52:30 +01:00
9d735b8562 Try migrating to depot (#9555) 2025-01-10 21:46:26 +01:00
873f20bc0e [CI][FRONT] Storybook tests sharding (#9448)
# Introduction
The idea here is to improve perf nor fluidity of both storybook build
and tests execution duration.

## Levers:
- Storybook tests
[shards](https://storybook.js.org/docs/writing-tests/test-runner)
- Refactored storybook's build caching using `actions/cache/restore` and
`actions/cache/save` to avoid useless computation with we wanna just
write or retrieve it
- Running storybook build with --test
[flag](https://storybook.js.org/docs/api/main-config/main-config-build)
( please note that we only disable docs addons in order to keep coverage
up and running )

closes https://github.com/twentyhq/core-team-issues/issues/49
2025-01-10 18:40:03 +01:00
654a0bb79e Fix CI Server 2025-01-10 12:29:22 +01:00
4c8c338316 Update ci runner for sb build 2025-01-09 18:58:36 +01:00
c39af5f063 Add Integration and unit tests on Billing (#9317)
Solves [ https://github.com/twentyhq/private-issues/issues/214 ]

**TLDR**
Add unit and integration tests to Billing. First approach to run jest
integration tests directly from VSCode.

**In order to run the unit tests:**
Run unit test using the CLI or with the jest extension directly from
VSCode.

**In order to run the integration tests:**
Ensure that your database has the billingTables. If that's not the case,
migrate the database with IS_BILLING_ENABLED set to true:
` npx nx run twenty-server:test:integration
test/integration/billing/suites/billing-controller.integration-spec.ts`

**Doing:**
- Unit test on transformSubscriptionEventToSubscriptionItem
- More tests cases in billingController integration tests.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2025-01-09 18:30:41 +01:00
afae244057 Add E2E tests (#9309)
Try adding E2E tests when labelling the PR or merging on main branch
2025-01-02 13:28:02 +01:00
4e496a9025 Delete .github/ISSUE_TEMPLATE/oss-gg-hack-submission.yml (#9271) 2024-12-29 14:32:47 +01:00
811002d8b9 Github CI workflow fix (#9137) 2024-12-19 17:01:58 +01:00
c754585e47 Basic test verifying if demo account is working properly (#8442) 2024-12-17 13:56:00 +01:00
08a9db2df6 Add Twenty Shared & Fix profile image rendering (#8841)
PR Summary: 

1. Added `Twenty Shared` Package to centralize utilitiies as mentioned
in #8942
2. Optimization of `getImageAbsoluteURI.ts` to handle edge cases


![image](https://github.com/user-attachments/assets/c72a3061-6eba-46b8-85ac-869f06bf23c0)

---------

Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-12-17 09:24:21 +01:00
23015de996 Add migration ci check (#8867)
Fixes #8865

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-09 17:15:24 +01:00
27eae53d0a Updated website docs and /twenty-server/.env (#8801)
Fix for the issue Incorrect Database Connection String in .env File
#8741

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-11-29 14:12:09 +01:00
bd18eb8b42 Add logging for scopeid error (#8513)
Can't figure out https://github.com/twentyhq/twenty/issues/8347 so I'm
adding logs, maybe it'll help debug in the future!
2024-11-15 14:16:09 +01:00
736635a94b Begin moving to postgres spilo + adding pgvector (#8309)
We will remove the `twenty-postgres` image that was used for local
development and only use `twenty-postgres-pilo` (which we use in prod),
bringing the development environment closer to prod and avoiding having
to maintain 2 images.


Instead of provisioning the super user after the db initialization, we
directly rely on the superuser provided by Spilo for simplicity. We also
introduce a change that tries to create the right database (`default` or
`test`) based on the context.
  

How to test:
```
docker build -t twentycrm/twenty-postgres-spilo:latest -f ./packages/twenty-docker/twenty-postgres-spilo/Dockerfile .
docker images --no-trunc | grep twenty-postgres-spilo
postgres-on-docker:
	docker run \
	--name twenty_pg \
	-e PGUSER_SUPERUSER=twenty \
	-e PGPASSWORD_SUPERUSER=twenty \
	-e ALLOW_NOSSL=true \
	-v twenty_db_data:/home/postgres/pgdata \
	-p 5432:5432 \
	REPLACE_WITH_IMAGE_ID
```
2024-11-15 09:38:30 +01:00
a799370483 Aggregated queries #1 (#8345)
First step of https://github.com/twentyhq/twenty/issues/6868

Adds min.., max.. queries for DATETIME fields
adds min.., max.., avg.., sum.. queries for NUMBER fields 

(count distinct operation and composite fields such as CURRENCY handling
will be dealt with in a future PR)

<img width="1422" alt="Capture d’écran 2024-11-06 à 15 48 46"
src="https://github.com/user-attachments/assets/4bcdece0-ad3e-4536-9720-fe4044a36719">

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
2024-11-14 18:05:05 +01:00
bec4da496d Data settings new layout - anchor navigation (#8334)
Follow-up of https://github.com/twentyhq/twenty/pull/7979
Navigation between settings and fields tabs is now reflected in URL. 
<img width="1106" alt="Capture d’écran 2024-11-07 à 18 38 57"
src="https://github.com/user-attachments/assets/24b153ef-9e68-4aa2-8e3a-6bf70834c5ad">

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: gitstart-twenty <140154534+gitstart-twenty@users.noreply.github.com>
Co-authored-by: Weiko <corentin@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-11-11 14:06:38 +01:00
a7a7d62502 Fix CI timeout (#8408) 2024-11-08 13:53:38 +01:00
d8831512d4 Add CI timeouts and enable playwright (#8405) 2024-11-08 12:24:22 +01:00
d9c0530dd3 Integration test : Sync mode + db reset option + cleaning (#8376)
Run the CI integrationin sync mode
and add the option to run it without db reset
cleaning all the useless integration test

---------

Co-authored-by: guillim <guillaume@twenty.com>
2024-11-07 17:22:47 +01:00
695991881f 6071 return only updated fields of records in zapier update trigger (#8193)
- move webhook triggers into `entity-events-to-db.listener.ts`
- refactor event management
- add a `@OnDatabaseEvent` decorator to manage database events
- add updatedFields in updated events
- update openApi webhooks docs
- update zapier integration
2024-11-04 17:44:36 +01:00
740ca550cc Fix Danger CI not running (#8299)
The Danger CI was not running anymore (we need it for CLA/Congrats bot)
2024-11-04 08:37:44 +01:00
7b467822f1 Fix tinybird Ci (#8211)
Ignore ci job if no change in tinybird
2024-10-30 15:36:47 +00:00
57d9b8e8b4 feat: generate secret function and replaced few instances (#7810)
This PR fixes #4588

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-30 12:07:11 +01:00
95b475c855 Fixes "No Result" flash and add a separator (#8140)
Fix for #8137

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-10-29 11:36:25 +01:00
f79e904dd6 Enable Tinybird CI (#8168)
Test to enable it in a second PR. I think it needed to merged in main
first
2024-10-29 10:43:04 +01:00
8ef4efa0f5 add twenty-tinybird package (#8030)
https://github.com/twentyhq/private-issues/issues/75

**TLDR**

Add twenty-server package, wich contains the last tinybird datasources
and pipes used in analytics.

This new version of the API endpoints, pipes and datasources are
inspired by the implementation of dub.co
(https://github.com/dubinc/dub/blob/main/packages/tinybird/).

It contains the webhooks analytics, serverless functions duration and
serverless functions error count analytics. As well as


**In order to test**

- Follow the instructions in the README.md on twenty-tinybird using your
admin token from twenty_analytics_playground if you want to modify them.
- For a better experience add the extension Tinybird support for VsCode 
- If you want more info about datasources and pipes please read the
tinybird docs.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-10-29 10:31:05 +01:00
1aa961dedf 101 featch available variables from previous steps (#8062)
- add outputSchema in workflow step settings
- use outputSchemas to compute step available variables


https://github.com/user-attachments/assets/6b851d8e-625c-49ff-b29c-074cd86cbfee
2024-10-28 11:25:29 +00:00
dcf92ae7f1 Migrate to twenty-ui - utilities/dimensions (#7949)
This PR was created by [GitStart](https://gitstart.com/) to address the
requirements from this ticket:
[TWNTY-7539](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7539).

 --- 

### Description

- Move the utilities/dimensions from twenty-front to twenty-ui and
update imports\

Fixes twentyhq/private-issues#79

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-23 17:09:32 +02:00
373926b895 Secure connexion between TinyBird and webhookResponseGraph (#7913)
TLDR:
Secure connexion between tinybird and twenty using jwt when accessing
datasource from tinybird.

Solves:
https://github.com/twentyhq/private-issues/issues/73


In order to test:

1. Set ANALYTICS_ENABLED to true
2. Set TINYBIRD_JWT_TOKEN to the ADMIN token from the workspace
twenty_analytics_playground
3. Set TINYBIRD_JWT_TOKEN to the datasource or your admin token from the
workspace twenty_analytics_playground
4. Create a Webhook in twenty and set wich events it needs to track
5. Run twenty-worker in order to make the webhooks work.
6. Do your tasks in order to populate the data
7. Enter to settings> webhook>your webhook and the statistics section
should be displayed.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-10-21 17:42:52 +02:00
784770dfe8 Disable Github runners front CIs 2024-10-21 14:23:57 +02:00
eaab2d0dd2 Fix CI not running on main 2024-10-21 13:32:54 +02:00
2f72e22ff9 Fix CI not running on main 2024-10-21 13:19:35 +02:00
b914182b78 Update workflows to optimize CI processes (#7828)
This Pull Request addresses the need to optimize our Continuous
Integration (CI) workflows for Playwright tests and release processes.
The changes implemented aim to reduce unnecessary resource usage by
conditionally executing jobs based on relevant file changes and
Implement https://github.com/tj-actions/changed-files step

## Changes logs
- Updated `ci-test-docker-compose.yaml , ci-chrome-extension.yaml ` to
check for changed files before running tests.
- Updated `ci-front.yaml , ci-utils.yaml , ci-website.yaml ,
ci-server.yaml` to check for changed files before running tests.
- Enhanced `playwright.yml` to skip unnecessary tests based on file
changes.
2024-10-21 12:02:14 +02:00
17b934e22b Migrate to shipfox 2024-10-18 18:36:01 +02:00
fad1363095 Fix CIs not running 2024-10-17 19:35:27 +02:00
f26c65fd41 Try out depot as CI provider 2024-10-17 11:50:43 +02:00
a16a88fa8e Move Front CI from Github runner to shipfox runner (#7749)
Trying out a CI runner provider called "ShipFox"
(https://docs.shipfox.io/)

Let's see how it works ;)
2024-10-16 14:57:35 +02:00
b41d1d2a4b Added oss-gg hackathon issue opening template (#7662)
## Added [oss.gg](https://oss.gg/) hackathon issue opening template 

### This is issue template is consistent in other oss-gg participating
repos. So this helps the participant to open the issue with proof of
work and makes it easy for the maintainer to award points on the simple
side quests.

### If any changes needed lmk

### {can I get some Brownie Point for this template addition}?

### Thank You 🙂 

#### DEMO

![image](https://github.com/user-attachments/assets/864b2c9e-c147-4e67-bdd7-e90eb481ba44)

![image](https://github.com/user-attachments/assets/799edbab-0039-435d-8608-1a809ddb7533)
2024-10-14 08:44:45 +02:00
2472b3faaf Diagnostics CI size issue 2024-10-05 09:57:39 +02:00
bd305c8432 Fix worker run ci step (#7437)
## Context
Updating the Worker / Run step to run in sync mode with in-memory cache
type so it does not hang forever in the CI.
2024-10-04 19:28:29 +02:00
098d43d460 Delete .github/workflows/pm-actions-cool.yaml (#7401)
😭
2024-10-02 18:40:13 +02:00
2cd3219636 Create pm-actions-cool.yaml (#7395)
Adding actions Cool for assigning issues from comments
2024-10-02 17:38:15 +02:00
eef7f1661d feat: add integration tests (#6923)
### Summary

This PR introduces several integration tests, a mix of manually written
tests and those generated using the `generate-integration-tests` Python
script located in the `scripts` folder.

### Tests Added:
- **Authentication tests**: Validating login, registration, and token
handling.
- **FindMany queries**: Fetching multiple records for all existing
entities that do not require input arguments.

### How the Integration Tests Work:
- A `setupTest` function is called during the Jest test run. This
function initializes a test instance of the application and exposes it
on a dedicated port.
- Since tests are executed in isolated workers, they do not have direct
access to the in-memory app instance. Instead, the tests query the
application through the exposed port.
- A static accessToken is used, this one as a big expiration time so it
will never expire (365 years)
- The queries are executed, and the results are validated against
expected outcomes.

### Current State and Next Steps:
- These tests currently run using the existing development seed data. We
plan to introduce more comprehensive test data using `faker` to improve
coverage.
- At the moment, the only mutation tests implemented are for
authentication. Future updates should include broader mutation testing
for other entities.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-20 11:02:52 +02:00
a850b43c52 add contibuting_example.md (#6998)
add a contributing_example.md on folder .github

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-09-12 12:31:34 +02:00
b1fbf4b683 E2E tests (#6717)
Continuation of #6644 

Now chromium browser is used in workspaces tests instead of firefox and
screenshots after each test are properly saved in one folder when run
from IDE and from terminal using `yarn test:e2e` command
2024-08-27 11:07:10 +02:00
0349d02ede 6404: prevent contributors from opening a PR on a main branch (#6419)
https://github.com/twentyhq/twenty/issues/6404

Used a Git hook`(pre-push)` to prevent pull requests from being created
from the main branch.
pre-push hook ref: https://git-scm.com/docs/git-push
2024-07-26 08:23:58 +02:00
6683ffb890 Clarify storybook tests (#6073)
In this PR, I'm simplifying storybook setup:
1) Remove build --test configuration that prevent autodocs. We are not
using autodocs at all (the dev experience is not good enough), so I have
completely disabled it.
2) Clarify `serve` vs `test` vs `serve-and-test` configurations


After this PR:
- you can serve storybook in two modes: `npx nx run
twenty-front:storybook:serve:dev` and `npx nx run
twenty-front:storybook:serve:static`
- you can run tests agains an already served storybook (this is useful
in dev so you don't have to rebuild everytime to run tests): `npx nx run
twenty-front:storybook:test`
- you can conbine both: `npx nx run
twenty-front:storybook:serve-and-test:static`
2024-06-30 20:02:13 +02:00
2fdd2f4949 Fix/release workflow (#5802)
Here is a fix for https://github.com/twentyhq/twenty/issues/5163

I tested it on another repo and should work as intended this time
arround.

I've created two workflows
- One that creates a PR
- The second that watch PR merge with specific labels
- I also check the author of the PR to make sure it was created by a bot

You can now disable the creation of the a draft release

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-06-12 21:11:58 +02:00