-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Create table and typeorm entity for tests (no-changelog) #11505
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good 👍 Couple comments / questions
@Entity() | ||
@Index(['workflow']) | ||
@Index(['evaluationWorkflow']) | ||
export class TestEntity extends WithTimestamps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is very overloaded term. Could we use something more specific? E.g. WorkflowTest
? Also could we add a short description for this entity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what we should name this, but I'm certain that calling this Test*
would be confusing for many people.
Even WorkflowTest
is overloaded, as it can already either refer to the special test type we have nodes-base
, as well as the test-workflows repo.
name: string; | ||
|
||
@RelationId((test: TestEntity) => test.workflow) | ||
workflowId: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't he id
of WorkflowEntity
a string?
workflow: WorkflowEntity; | ||
|
||
@RelationId((test: TestEntity) => test.evaluationWorkflow) | ||
evaluationWorkflowId: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, shouldn't it be string?
evaluationWorkflowId: number; | ||
|
||
@ManyToOne('WorkflowEntity', 'evaluationTests') | ||
evaluationWorkflow: WorkflowEntity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have some documentation what this relation means?
.withForeignKey('evaluationWorkflowId', { | ||
tableName: 'workflow_entity', | ||
columnName: 'id', | ||
}) | ||
.withForeignKey('annotationTagId', { | ||
tableName: 'annotation_tag_entity', | ||
columnName: 'id', | ||
}).withTimestamps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that these don't have onDelete
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two references are nullable, and we don't want to delete a test when an evaluation workflow or specific annotation tag being deleted. So the right setting should be ON DELETE SET NULL
I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever we decide to rename the entity to, we should update the PR title accordingly, so that when any of of visit this PR in the future, the word tests
isn't confusing 🙏🏽.
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
This PR introduces a new table for storing Tests.
This is part of a larger initiative to enhance our workflow evaluation capabilities.
Changes
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)