Skip to content

[dashboard] Support multiple repos#1514

Merged
fluttergithubbot merged 10 commits intoflutter:mainfrom
CaseyHillers:dashboard-repo
Jan 11, 2022
Merged

[dashboard] Support multiple repos#1514
fluttergithubbot merged 10 commits intoflutter:mainfrom
CaseyHillers:dashboard-repo

Conversation

@CaseyHillers
Copy link
Contributor

@CaseyHillers CaseyHillers commented Dec 10, 2021

Fixes flutter/flutter#53714
Fixes flutter/flutter#94522

Changes

  • Add currentRepo and repos to BuildState
    • Can be updated from UI or the URL
  • Modify updateCurrentBranch to be updateCurrentRepoBranch as it always requires a full flush of the data

engine dashboard
cocoon dashboard

Test Env

https://testchillers-dot-flutter-dashboard.appspot.com/#/build?repo=engine&branch=main

Go to settings, then change the repository.

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 doesn't need to be run every 30 seconds as this is almost never changes (order of once a month)

@CaseyHillers CaseyHillers marked this pull request as ready for review December 14, 2021 00:27
@CaseyHillers
Copy link
Contributor Author

@goderbauer can you take a look on the Navigator side of this PR, and let me know if there's a better way of passing around query parameters?

Copy link
Member

Choose a reason for hiding this comment

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

This looks like a strange side effect from build.

Comment on lines 103 to 104
Copy link
Member

Choose a reason for hiding this comment

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

So, the branch and repository information get passed twice? Once in the name of the route and once as arguments object?

Copy link
Member

Choose a reason for hiding this comment

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

It looks like "onGenerateRoute" just ignores the arguments, though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better way of passing the args from onGenerateRoute? I'm doing

                  repo: uriData.queryParameters['repo'],
                  branch: uriData.queryParameters['branch'],

to initialize the fields based on what was passed from RouteSettings

Copy link
Contributor Author

@CaseyHillers CaseyHillers Dec 16, 2021

Choose a reason for hiding this comment

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

I removed the settings, but I still needed to pass RouteSettings.name in onGenerateRoute so the URL would be updated

@CaseyHillers
Copy link
Contributor Author

Friendly ping now that the code freeze is over

Friendly ping

Comment on lines +58 to +60
if (branch == 'master' || branch == 'main') {
branch = defaultBranches[repo];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the use case of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default, you land on flutter/master. If you were to swap the repo from flutter->engine, you would also need to change the branch from master->main.

if (valueMap != null) {
for (final MapEntry<String, String> mapEntry in valueMap.entries) {
_allProperties[mapEntry.key].stringValue = mapEntry.value;
if (_allProperties.containsKey(mapEntry.key)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this condition needed, what are cases where unexpected keys exist?

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 searching all the query parameters. Since this PR adds repo and branch query params, this needed to be updated to no-op on unknown keys.

Comment on lines 138 to 162
'Key': task.key.child.name,
// This prepares this api to support different repos.
'Owner': 'flutter',
'Repo': 'flutter',
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? Don't we want to support rerun on other repos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing the task key is sufficient since now every repo's builds are stored in Cocoon's datastore

Copy link
Contributor

@keyonghan keyonghan left a comment

Choose a reason for hiding this comment

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

LGTM from infra side.
Leave the approval to @goderbauer re Navigator side codes.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM for the Nav stuff.

Comment on lines +53 to +54
repo = widget.queryParameters['repo'] ?? 'flutter';
branch = widget.queryParameters['branch'] ?? 'master';
Copy link
Member

Choose a reason for hiding this comment

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

nit: you could remove the "?? 'flutter'" and "?? 'master'" here since that's duplicated in line 56/57 below.

@CaseyHillers CaseyHillers added the waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot label Jan 11, 2022
@fluttergithubbot fluttergithubbot merged commit 9e72e31 into flutter:main Jan 11, 2022
CaseyHillers pushed a commit to CaseyHillers/cocoon that referenced this pull request Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot

Projects

None yet

4 participants