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

Add Brave-specific restrictions to studies. #1239

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

goodov
Copy link
Member

@goodov goodov commented Oct 24, 2024

Add few restrictions to studies:

  • Channel and platform should be set (we have this in Python generator).
  • Ensure the version is Brave-like version.

@goodov goodov marked this pull request as ready for review October 24, 2024 11:48
@goodov goodov requested a review from a team as a code owner October 24, 2024 11:48
@goodov goodov enabled auto-merge October 24, 2024 12:01
errors.push(`Channel filter is required for study ${study.name}`);
} else {
// Check if duplicate channels are present.
const channelSet = new Set(study.filter.channel);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: What about making const hasDuplicates = (a) => a.length !== new Set(a).size; ?


if (
study.filter.platform === undefined ||
study.filter.platform.length === 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

if ((study.filter.platform?.length ?? 0) === 0) ?

);
}

if (maxVersion !== undefined && checkIfChromiumVersion(maxVersion)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about:

const checkVersion = (v: Version) => {...};
checkVersion(minVersion);
checkVersion(maxVersion);

?

@goodov goodov requested a review from atuchin-m October 24, 2024 12:30
@goodov goodov added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit 7252645 Oct 24, 2024
6 checks passed
@goodov goodov deleted the add-brave-restrictions branch October 24, 2024 13:39
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