Skip to content
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

Kick off data sources service #5022

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Nov 21, 2024

Summary

This service will contain all the business logic to deal with data
sources.

For the moment this only kicks off the get calls. But populating this should
allow others to work on other function definitions.

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@JAORMX JAORMX force-pushed the datasourceservice branch 2 times, most recently from 5e93fb8 to cb82429 Compare November 21, 2024 15:02
@JAORMX JAORMX marked this pull request as ready for review November 21, 2024 15:03
@JAORMX JAORMX requested a review from a team as a code owner November 21, 2024 15:03
@JAORMX JAORMX force-pushed the datasourceservice branch 4 times, most recently from 85d8635 to 5d646db Compare November 22, 2024 09:49
This service will contain all the business logic to deal with data
sources.

Signed-off-by: Juan Antonio Osorio <[email protected]>
@coveralls
Copy link

coveralls commented Nov 22, 2024

Coverage Status

coverage: 54.594% (-0.03%) from 54.624%
when pulling f63c683 on JAORMX:datasourceservice
into be22925 on mindersec:main.

Copy link
Contributor

@blkt blkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong here, please keep me honest.

Comment on lines +9 to +11
-- name: AddDataSourceFunction :one
INSERT INTO data_sources_functions (data_source_id, name, type, definition)
VALUES ($1, $2, $3, $4) RETURNING *;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: INSERTS should always specify project_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blkt there is no project_id in this table. It points to a data_sources row which already has a project ID check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add it?

Comment on lines +24 to +28
-- name: UpdateDataSourceFunction :one
UPDATE data_sources_functions
SET type = $3, definition = $4, updated_at = NOW()
WHERE data_source_id = $1 AND name = $2
RETURNING *;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: these statements should filter by project_id as well.

Comment on lines +35 to +38
-- name: DeleteDataSourceFunction :one
DELETE FROM data_sources_functions
WHERE data_source_id = $1 AND name = $2
RETURNING *;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: these statements should filter by project_id as well.

Comment on lines +70 to +72
-- name: ListDataSourceFunctions :many
SELECT * FROM data_sources_functions
WHERE data_source_id = $1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: this statement should join data sources to filter by project_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above.

@JAORMX
Copy link
Contributor Author

JAORMX commented Nov 22, 2024

@blkt @teodor-yanev and I talked about this and agreed to include the project ID in the functions and relationships tables. @blkt will bring this in and I'll rebase on top of it.

@JAORMX JAORMX mentioned this pull request Nov 23, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants