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

feat: add external_resources column to waypoints #1747

Conversation

florentcadot
Copy link
Contributor

@florentcadot florentcadot commented Feb 18, 2024

c2corg/c2c_ui#3697
Associated frontend PR: c2corg/c2c_ui#3846

How to test:

Run the added migration using docker-compose exec api .build/venv/bin/alembic upgrade head
Pull the associated front branch: feature/#3697-add-waypoints-external-resources

From the front app, create a new waypoint and fill the external_resources field. Then update the external resources of this.

Copy link
Member

@brunobesson brunobesson left a comment

Choose a reason for hiding this comment

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

LGTM, although I am not fluen with the backend. But the modifications ook consistent, and you tested it already :)

@lbesson
Copy link
Member

lbesson commented Feb 20, 2024

lgtm, maybe we could add some unit tests around this? That shoudln't be too complicated (mostly copy pasting how it's done with other documents?)

@florentcadot
Copy link
Contributor Author

florentcadot commented Feb 21, 2024

lgtm, maybe we could add some unit tests around this? That shoudln't be too complicated (mostly copy pasting how it's done with other documents?)

You're right!

I've added a simple model unit test in c2corg_api/tests/models/test_waypoint.py.
Do you want me to test if Waypoint instantiation with wrong local external_resource does not work ?
Maybe I should add some tests in views/test_waypoint as well ?

Thanks for the review guys 😄

@lbesson
Copy link
Member

lbesson commented Feb 22, 2024

the more tests, the better, but I'll let you judge to what extent you want to go :)

imho you can merge when you feel so

@florentcadot florentcadot force-pushed the feature/add-waypoints-external-resources branch from ad2205f to e6ed7c1 Compare February 25, 2024 13:10
@eddy-geek eddy-geek self-requested a review March 3, 2024 08:56
@brunobesson
Copy link
Member

Could you lint the files so I can merge?

@florentcadot florentcadot force-pushed the feature/add-waypoints-external-resources branch from e6ed7c1 to d20638b Compare March 4, 2024 17:51
@florentcadot
Copy link
Contributor Author

Could you lint the files so I can merge?

Do you need me to also fix the codacy error or it's fine ?

image

(It's just a convenient way to destructure the tuple returned by the function)

@brunobesson brunobesson merged commit 49d2462 into c2corg:master Mar 5, 2024
7 of 8 checks passed
@eddy-geek
Copy link

Do you need me to also fix the codacy error or it's fine ?

(It's just a convenient way to destructure the tuple returned by the function)

FYI _ as variable name is a usual way to signal you don't use it, tools will usually understand it.

ie

(_, waypoint) = self.put_success_all( ...

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.

4 participants