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

SW-1971 Add endpoint to transfer seeds to nursery #705

Merged
merged 1 commit into from
Oct 12, 2022
Merged

Conversation

sgrimm
Copy link
Contributor

@sgrimm sgrimm commented Oct 12, 2022

POST /api/v2/seedbank/accessions/{id}/transfers/nursery will withdraw seeds from
an accession and create a new seedling batch.

`POST /api/v2/seedbank/accessions/{id}/transfers/nursery` will withdraw seeds from
an accession and create a new seedling batch.
@sgrimm sgrimm requested a review from a team as a code owner October 12, 2022 19:28
@sgrimm
Copy link
Contributor Author

sgrimm commented Oct 12, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Contributor

@karthikbtf karthikbtf left a comment

Choose a reason for hiding this comment

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

lgtm

val date: LocalDate,
val destinationFacilityId: FacilityId,
@JsonSetter(nulls = Nulls.FAIL)
@Min(0) //
Copy link
Contributor

Choose a reason for hiding this comment

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

should the // be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's there to stop ktfmt from putting the annotations and the val on a single line, which I thought made the class harder to read since there's a mix of annotated and non-annotated properties. I initially tried adding an explanation after the // but that also added visual clutter.

The other option would be to put the annotated properties all together and let ktfmt do its default thing. I kind of like having properties in alphabetical order but maybe it's a bad tradeoff here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though maybe if I did // line-break or something, that might look okay and look less like a mistake; I'll try that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, this is fine, alphabetical order is easier to read/search.
Doe ktfmt have a config option to override default behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ktfmt is deliberately not configurable. It's of the class of code formatters like gofmt and Black that take an approach of, "The point of an automated formatter is to stop people from wasting time arguing about formatting choices, and adding a bunch of fine-grained settings would cause people to waste time fussing with the settings instead." So its only configuration option is to control which of two Kotlin style guides it follows.

When I've reported formatting problems, they've often agreed that it isn't acting as advertised and fixed the problems. I just filed an issue earlier today, in fact: facebook/ktfmt#360

Splitting on annotations has been an open request for a while and it sounds like the authors are on the fence about whether it's a good thing to change: facebook/ktfmt#226

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the info. Just so you know, this PR is now mentioned in the FB issues :)

@sgrimm sgrimm merged commit 3f37d21 into main Oct 12, 2022
@sgrimm sgrimm deleted the seed-transfer branch October 12, 2022 22:49
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.

2 participants