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

onlyOneEnglishDescription must return null for two en-US descriptions, etc. #573

Closed
ElectricNroff opened this issue Mar 13, 2022 · 3 comments · Fixed by #617
Closed

onlyOneEnglishDescription must return null for two en-US descriptions, etc. #573

ElectricNroff opened this issue Mar 13, 2022 · 3 comments · Fixed by #617
Assignees
Labels
Moderate 5-20 Hours Release 2.1 Issues to be fixed for 2.1

Comments

@ElectricNroff
Copy link
Contributor

function onlyOneEnglishDescription (arr) {
const arrayLength = arr.length
let numEnglishFound = 0 // for checking how many times an english field shows up
for (var i = 0; i < arrayLength; i++) {
if (arr[i].lang === 'en') {
numEnglishFound += 1
}
if (numEnglishFound > 1) { // return error if more than 1 english description is found
return null
}
}
return numEnglishFound
}

is incorrect because an English description doesn't require lang === 'en' (lang can be 'en' followed by other characters, and might not be all lowercase).

See CVEProject/quality-workgroup#6

Thus far, it's known that the submission is not valid if there are two objects that use identical lang fields to represent English. Also, it's known that the submission is valid if there are two objects that have lang fields for English, but each represents English as used in a different location (such as en-US and en-GB).

Presumably, lang fields that differ only in case should be considered identical when determining validity.

It might be unclear whether using "en" and "en-US" for different descriptions is ever meaningful, or should be allowed in a valid submission, e.g.,

{
  "lang": "en",
  "value": "The product crashes if the state field is not a valid state in the current country."
},
{
  "lang": "en-US",
  "value": "The product crashes if the state field is set to DC instead of one of the 50 states."
}
@jdaigneau5 jdaigneau5 added Release 2.1 Issues to be fixed for 2.1 Moderate 5-20 Hours labels Apr 4, 2022
@spant-mitre spant-mitre mentioned this issue Apr 4, 2022
spant-mitre added a commit that referenced this issue Apr 4, 2022
@jdaigneau5 jdaigneau5 linked a pull request Apr 5, 2022 that will close this issue
@slubar
Copy link
Contributor

slubar commented Apr 6, 2022

@ElectricNroff could you provide more information about the requirements and/or point to a User Story that describes them? It would be good to know if it is ok to have two descriptions of a language other than English. Also does 'en' and 'en-US' count as a duplicate (ignoring casing)?

@ElectricNroff
Copy link
Contributor Author

I currently don't know anything further about requirements. Your best option might be one of these two:

  1. Conclude that the unspecified behavior is not relevant to the initial release of CVE Services 2.x, because the QWG has not made any statements about it. In other words, for "two descriptions of a language other than English" it is equally valid to always accept the submission or always reject it. For submissions with both 'en' and 'en-US' descriptions, it is equally valid to always accept the submission or always reject it.
  2. Contact the QWG chairs to request that these scenarios be placed on the agenda for an upcoming QWG meeting.

@slubar
Copy link
Contributor

slubar commented Apr 7, 2022

Per a conversation with ElectricNroff, the implementation should support the requirement that rejectReasons cannot have more than one of the same English/location. For instance, there is no more than each one of en, en-us, en-gb, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Moderate 5-20 Hours Release 2.1 Issues to be fixed for 2.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants