WorryFree Computers   »   [go: up one dir, main page]

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

App Distribution: Add commands to manage groups #5978

Merged
merged 8 commits into from
Jun 15, 2023

Conversation

kaibolay
Copy link
Contributor

Description

  • Added appdistribution:group:create and appdistribution:group:delete.
  • Added --group-alias option to appdistribution:testers:add and appdistribution:testers:remove.

Sample Commands

$ firebase appdistribution:group:create "My Awesome Group" my-awesome-group
$ firebase appdistribution:testers:add --group-alias=my-awesome-group tester@one.tld tester@two.tld
$ firebase appdistribution:testers:remove --group-alias=my-awesome-group tester@one.tld tester@two.tld
$ firebase appdistribution:group:delete my-awesome-group

@kaibolay kaibolay requested a review from rebehe June 14, 2023 17:17
src/appdistribution/client.ts Show resolved Hide resolved
import { AppDistributionClient } from "../appdistribution/client";
import { getProjectName } from "../appdistribution/options-parser-util";

export const command = new Command("appdistribution:group:create <displayName> [alias]")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should alias be a named option for clarity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had it as an option before, but then changed my mind and decided against it. Mainly because it's an argument in group:delete - and I didn't want to change that.

src/commands/appdistribution-group-create.ts Outdated Show resolved Hide resolved
.before(requireAuth)
.action(async (emails: string[], options?: any) => {
const projectName = await getProjectName(options);
const appDistroClient = new AppDistributionClient();
const emailsToAdd = getEmails(emails, options.file);
utils.logBullet(`Adding ${emailsToAdd.length} testers to project`);
await appDistroClient.addTesters(projectName, emailsToAdd);
if (options.groupAlias) {
utils.logBullet(`Adding ${emailsToAdd.length} testers to group`);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Consider changing the plurality of testers depending on the length of the emails, like

marked(`The following param${plural ? "s are" : " is"} immutable and won't be changed:`)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm too lazy - there are too many places to change

src/commands/appdistribution-testers-add.ts Outdated Show resolved Hide resolved
src/test/appdistro/client.spec.ts Outdated Show resolved Hide resolved
@kaibolay kaibolay requested a review from bkendall June 14, 2023 19:49
@kaibolay kaibolay changed the title App Distribution: Add command to manage groups App Distribution: Add commands to manage groups Jun 14, 2023
@codecov-commenter
Copy link
codecov-commenter commented Jun 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (d4d1952) 54.91% compared to head (1b4d7e5) 54.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5978      +/-   ##
==========================================
+ Coverage   54.91%   54.95%   +0.04%     
==========================================
  Files         342      342              
  Lines       23247    23264      +17     
  Branches     4753     4754       +1     
==========================================
+ Hits        12766    12785      +19     
+ Misses       9351     9350       -1     
+ Partials     1130     1129       -1     
Impacted Files Coverage Δ
src/appdistribution/client.ts 93.58% <100.00%> (+1.78%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bkendall bkendall requested review from joehan and removed request for bkendall June 15, 2023 14:28
@kaibolay kaibolay requested review from bkendall and joehan and removed request for bkendall June 15, 2023 19:33
@kaibolay kaibolay merged commit d7ed2a9 into master Jun 15, 2023
32 of 33 checks passed
@kaibolay kaibolay deleted the kb/more_group_management branch June 15, 2023 19:58
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.

None yet

4 participants