Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

V0.4 #92

Merged
merged 10 commits into from
Jun 20, 2017
Merged

V0.4 #92

merged 10 commits into from
Jun 20, 2017

Conversation

sdelatorrep
Copy link
Contributor

v0.4 proposal

@@ -226,9 +255,12 @@ message BeaconAlleleResponse {
// Allele request as interpreted by the beacon.
BeaconAlleleRequest allele_request = 4;

// Version of the API provided by the beacon.
string api_version = 5;
Copy link
Member

Choose a reason for hiding this comment

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

I think the convention is not to change attribute <-> index assignments, if the number has been used. The order in the spec doesn't matter. So it should be string api_version = 6.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point. I didn't notice that, my mistake. Fixing it.

@mbaudis
Copy link
Member

mbaudis commented May 2, 2017

+1, after considering my comment on the numbering in .proto

@antbro
Copy link

antbro commented May 2, 2017 via email

@sdelatorrep
Copy link
Contributor Author

Hi @antbro . You're absolutely right but Consent Codes is the only one implemented as far as I know, so we thought it was better to include it in v0.4 and add ADA-M later when it's done. But the most important point of this PR is to resume some discussions that have been forgotten for a while (like this one you just raised).

@antbro
Copy link

antbro commented May 2, 2017 via email

@jrambla
Copy link
Collaborator

jrambla commented May 3, 2017

+1 to its current status.

@mbaudis
Copy link
Member

mbaudis commented May 11, 2017

Merging this? @mcupak?

@@ -16,8 +16,8 @@ message BeaconAlleleRequest {
// Accepted values: non-negative integers smaller than reference length.
int64 start = 2;

// Reference bases for this variant (starting from `start`).
//
// Reference bases for this variant (starting from `start`). OPTIONAL.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this needs clarification. It's not really optional from the querier (request) perspective, it's from the beacon perspective. If a beacon doesn't store reference bases, it cannot reply to a question with reference bases, right? And if it does store reference bases, a query without them might be ambiguous. I think we should either describe how a beacon should behave in these situations, or have a field under the info endpoint disclosing what the beacon supports.

Copy link
Member

Choose a reason for hiding this comment

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

The most stringent way would be to have Beacons returning a verbose error if they do not support reference bases.

// If a value is provided here, a Beacon should return an error message if it does not 
// support reference bases for variant annotations.

Interestingly, ga4gh-schemas are not explicit about this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi Miro,
The issue #59 has plenty of +1's and yourself seem to suggest making it optional...
Are you just asking for a better clarification of the schema comments?

Copy link
Contributor

Choose a reason for hiding this comment

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

UPDATE: #59 (comment)

}

// If include_dataset_responses is true, use this field to filter the response.
FilterDatasetResponse filter_response = 8;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if I like this approach. If there are only 2 options, it should be a boolean instead of an enum. We also already have a field include_dataset_responses, which is related, so maybe the best thing is to have one filter field (e.g. include_dataset_responses=all|true|false|none). Ideally the name of the field would also explain we're filtering on exists. Thoughts?

Copy link
Contributor Author

@sdelatorrep sdelatorrep May 12, 2017

Choose a reason for hiding this comment

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

I prefer explicit names than true/false values when the meaning is not obvious, as in this case. But I agree that we can reuse include_dataset_responses and convert it to a string which accepts the values: all|hit|miss|none (the latter being the default value if the field is omitted). We can update #56 with the final decision.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to all|hit|miss|none in include_dataset_responses

Copy link
Contributor

Choose a reason for hiding this comment

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

Comments from the workshop yesterday:

  • include null in the filter
  • come up with a nice way to filter and name the parameter

@@ -85,7 +93,7 @@ message BeaconDataset {

// Organization owning a beacon.
message BeaconOrganization {
// Unique identifier of the organization.
// Unique identifier of the organization. Use reversed namespace convention (e.g. org.ga4gh)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd replace "reversed namespace convention" with "reverse domain name notation", as that's the common term for this. Also missing punctuation and should hard-wrap to 80 characters (https://github.com/ga4gh/beacon-team/blob/develop/CONTRIBUTING.md#syntax-style-and-conventions).

Copy link
Member

Choose a reason for hiding this comment

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

+1 on @mcupak comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@@ -113,10 +121,10 @@ message BeaconOrganization {

// Beacon.
message Beacon {
// Unique identifier of the beacon.
// Unique identifier of the beacon. Use reversed namespace convention (e.g. org.ga4gh.beacon)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as the corresponding field under BeaconOrganization.

Copy link
Member

Choose a reason for hiding this comment

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

Same +1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

string id = 1;

// Name of the beacon.
// Name of the beacon. )
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo (closing bracket with no opening).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@mcupak
Copy link
Contributor

mcupak commented May 11, 2017

I like it overall, but I've noted a few suggestions under the corresponding lines. It would be much better to have separate PRs for the individual issues for easier discussion.

// - HTTP error code 412: Missing mandatory parameters: referenceName, position/start and/or assemblyId
// - HTTP error code 412: The reference genome of this dataset X does not match the provided value
// - HTTP error code 412: Invalid alternateBases parameter, it can only be [ACTG]+
// - HTTP error code 412: Invalid referenceBases parameter, it can only be [ACTG]+
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

NOT_FOUND = 2; // HTTP error code 404
PRECONDITION_FAILED = 3; // HTTP error code 412
}

// Numeric error code.
int32 error_code = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is int, then the enum above is not used and should be removed, right? I think it's fine without the enum and just recommend values in the comment, like below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a mistake. It should be: ErrorCode error_code = 1;
The idea is to have a common list of errors. If a new error code is required, initially GENERIC_ERROR will be used by the programmer and, later, this new error will be included in the specification.

// Error message.
// Error message.
// Accepted values:
// - HTTP error code 400: generic error. If not
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfinished sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes... I'll fix it.

// Error message.
// Accepted values:
// - HTTP error code 400: generic error. If not
// - HTTP error code 401: Unauthenticated users cannot access this dataset
Copy link
Contributor

Choose a reason for hiding this comment

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

403 is more common. It looks like 401 is for something very specific in HTTP.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi Miro,

According to this page (one between many) https://en.wikipedia.org/wiki/HTTP_403...
Status codes 401 (Unauthorized) and 403 (Forbidden) have distinct meanings.
A 401 response indicates that access to the resource is restricted, and the request did not provide any HTTP authentication. It is possible that a new request for the same resource will succeed if authentication is provided. The response must include an HTTP WWW-Authenticate header to prompt the user-agent to provide credentials.
A 403 response generally indicates one of two conditions:
Authentication was provided, but the authenticated user is not permitted to perform the requested operation.
The operation is forbidden to all users. For example, requests for a directory listing return code 403 when directory listing has been disabled.

// - HTTP error code 412: Missing mandatory parameters: referenceName, position/start and/or assemblyId
// - HTTP error code 412: The reference genome of this dataset X does not match the provided value
// - HTTP error code 412: Invalid alternateBases parameter, it can only be [ACTG]+
// - HTTP error code 412: Invalid referenceBases parameter, it can only be [ACTG]+
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe 400 Bad Request would be better for all of the 412, if we're mapping to HTTP?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to 400

// Numeric error code.
int32 error_code = 1;

// Error message.
// Error message.
// Accepted values:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably just refer to these as standard values but allow for custom messages and codes added by beacons as they see fit. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is to standardise the error codes and messages (#54). If a programmer requires a new message, then s/he should use error_code=GENERIC_ERROR and set their custom message in the message field (maybe this should be clarified in the comments). Next releases of the API specification might include these new error messages.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I rather prefer to have fixed messages to avoid custom messages to re-interpret or add confusion. If the "official" message is not clear enough, my guess is that we should improve it.

@mcupak
Copy link
Contributor

mcupak commented Jun 20, 2017

Merging the PR as this is a big step in the right direction. Let's clean up the spec in separate PRs.

@mcupak mcupak merged commit f17d295 into ga4gh-beacon:develop-proto Jun 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants