Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Add openshiftMasterURL to list of builds #70

Merged
merged 7 commits into from
Oct 5, 2018
Merged

Add openshiftMasterURL to list of builds #70

merged 7 commits into from
Oct 5, 2018

Conversation

psturc
Copy link
Contributor

@psturc psturc commented Oct 3, 2018

Motivation

https://issues.jboss.org/browse/AEROGEAR-7979

How to verify

πŸ’β€β™‚οΈ Feel free to use my project on community cluster (ping me for user/pass if you don't have it)

  1. Clone this branch and follow instructions from here
  2. Make sure the OpenShift project you are targeting has Mobile CI/CD provisioned and also has some existing builds
  3. In MDC, go to Builds, click on Build and verify all links (Build #x) are pointing to the correct page in OpenShift Console (also check those in build history)

@coveralls
Copy link

coveralls commented Oct 3, 2018

Coverage Status

Coverage increased (+1.02%) to 69.468% when pulling 206a43c on AEROGEAR-7979 into 791ce07 on master.

@psturc psturc requested a review from wei-lee October 3, 2018 07:39
@psturc psturc changed the title [WIP] Add openshiftMasterURL to list of builds Add openshiftMasterURL to list of builds Oct 3, 2018
return c.JSON(http.StatusOK, builds)
response := &response{
BuildList: *builds,
OpenshiftMasterURL: mbh.openshiftMasterURL,
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than return the url on its own, I think maybe use it to construct the url of each build, and then add the url to each build as a separate field (like buildURL)? There are at least 2 benefits:

  1. Cleaner API. Otherwise without some documentation, people wouldn't be able to understand why the master url is returned here.
  2. Hide the logic to build the full url of the builds. This only needs to be done on the server and the clients don't need to care.

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.

I think it sounds reasonable. This will definitely reduce amount of changes needed in UI code to reflect this, which I'm looking at right now. Thanks

@psturc
Copy link
Contributor Author

psturc commented Oct 3, 2018

@wei-lee @jhellar PR is ready for E2E verification.
Tests are failing because of missing metadata in this test because of this line. I will fix this asap.


// Extend existing struct buildV1.BuildList so each build contains URL
// pointing to build in OpenShift Console
func extendBuildList(bl buildV1.BuildList, mbh MobileBuildsHandler) *extendedBuildList {
Copy link
Contributor

Choose a reason for hiding this comment

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

don't think we need to pass the MobileBuildsHandler object here. It's better to just pass the url and the namespace value as args explicitly here.

BuildURL: buildURL,
}
}
return &extendedBuildList{
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think of moving the extra field (and new types) to the BuildCRUDL class? The end result is the same, but I think they belong to the our core business, which is defined in the mobile package. The web handlers here should only be responsible for things like input validation, data transformation and error handling etc.

Copy link
Contributor

@jhellar jhellar left a comment

Choose a reason for hiding this comment

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

Verified and agree with Wei's comments, otherwise LGTM.

@jhellar jhellar merged commit 565cd57 into master Oct 5, 2018
@grdryn grdryn deleted the AEROGEAR-7979 branch January 7, 2019 12:14
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.

None yet

4 participants