-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy Applications from Enterprise GitHub and GitLab (#4782)
* Frontend for new yaml based git endpoints - register github.com and gitlab.com endpoints and connect with credentials - register and connect to github and gitlan enterprise instances - select these as sources when deploying a cf application * Add proxy single request API endpoint * Add endpoint plugin generation from a YAML file * Deploy to CF from private GitHub and GitLab repos * Use subtypes for YAML generated endpoints * Nicer YAML format; ignore unknown endpoint types in the DB * Fix merge issues and add icon indicator for private repositories * Fix lint issues * Add details component to show username and avatar on endpoint card * Various fixes and improvements * Fix lint issue * Fix merge issues * Unit test fixes * Unit test fix following merge * One more unit test fix * Fix backend unit tests * Fix the deploy types todo (in a verbose way) * Ignore commit id when possible * Fix redeploy stepper * Fix minor bugs in new register git stepper * multiple fixes, remaining todos * update github/gitlab connect readme's, including scope info * In connect helper remove duped header * Fix multiple gitlab issues * Fix deploy app home screen link for github/gitlab with credentials * Ensure app git tab only shows if we have access to repo - can happen if others view app deployed via private repo * Fix clone url & improve error messaging * Improve cf app summary page git info * Fix issue where... - we're waiting for an endpoint that doesn't exist.. in an effect - that endpoint then is created - the effect then fires off the request... long after it should have stopped * Fix multiple gitlab enterprise issues - enterprise gits weren't showing as deploy source types - enterprise gits that weren't connected failed to work (fetching data & deploying) * Fix git enterprise ssl setting, provide hint at time of url required * Show private repo indicator on app git tab * app git tab: handle git fetch failure beter - also rework observables in page * Changes following quick self review * Fix linting * Fixes following testing * Use enum for github string * Ensure Git entities associated with an endpoint are removed on endpoint unregister/disconnect * Fix unit test * Tidy up backend changes * Update app summary page * Show no content message if app git tab cannot show info * display password field instead of text area for token * other changes following review * Fix other issues raised in review (all from single comment) * Fix frontend after updated backend * Apply path escaping fix when url is recreated * Fix some of the e2e tests * Fixes after testing * Fix more e2e tests * Changes following review Co-authored-by: Richard Cox <richard.cox@suse.com> Co-authored-by: Ivan Kapelyukhin <ikapelyukhin@suse.com>
- Loading branch information
1 parent
8fb79dd
commit 3363703
Showing
98 changed files
with
2,528 additions
and
1,167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 104 additions & 82 deletions
186
.../applications/application/application-tabs-base/tabs/gitscm-tab/gitscm-tab.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,109 @@ | ||
<app-tile-grid class="gitscm-tab" *ngIf="stratosProject$ | async as stratosProject"> | ||
<app-tile-group> | ||
<app-tile> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Deployment Information</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<div class="gitscm-tab__deployment"> | ||
<app-metadata-item label="Repository"> | ||
<a href="{{(gitSCMRepo$ | async)?.html_url}}" target="_blank">{{stratosProject.deploySource.project }}</a> | ||
</app-metadata-item> | ||
<app-metadata-item label="Branch"> | ||
<a href="{{(gitSCMRepo$ | async)?.html_url}}/tree/{{ stratosProject.deploySource.branch}}" target="_blank"> | ||
{{ stratosProject.deploySource.branch}} | ||
</a> | ||
</app-metadata-item> | ||
<div class="gitscm-tab__deployment__commit"> | ||
<div> | ||
<app-metadata-item label="Commit"> | ||
<a href="{{(commit$ | async)?.html_url}}" target="_blank">{{ stratosProject.deploySource.commit | limitTo: 8}}</a> | ||
<app-loading-page [isLoading]="isLoading$" text="Retrieving Git Details"> | ||
<div> | ||
<app-tile-grid class="gitscm-tab" *ngIf="hasRepo$ | async as hasRepo"> | ||
<app-tile-group> | ||
<app-tile *ngIf="appService.applicationStratProject$ | async as stratosProject"> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Deployment Information</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<div class="gitscm-tab__deployment"> | ||
<app-metadata-item label="Repository"> | ||
<a href="{{(gitSCMRepo$ | async)?.html_url}}" | ||
target="_blank">{{stratosProject.deploySource.project }}</a> | ||
</app-metadata-item> | ||
<app-metadata-item label="Branch"> | ||
<a href="{{(gitSCMRepo$ | async)?.html_url}}/tree/{{ stratosProject.deploySource.branch}}" | ||
target="_blank"> | ||
{{ stratosProject.deploySource.branch}} | ||
</a> | ||
</app-metadata-item> | ||
<div class="gitscm-tab__deployment__commit"> | ||
<div> | ||
<app-metadata-item label="Commit"> | ||
<a href="{{(commit$ | async)?.html_url}}" | ||
target="_blank">{{ stratosProject.deploySource.commit | limitTo: 8}}</a> | ||
</app-metadata-item> | ||
</div> | ||
<div class="gitscm-tab__deployment__commit-warning" *ngIf="(isHead$ | async) === false"> | ||
<div> | ||
<mat-icon color="warn">warning</mat-icon> | ||
</div> | ||
<div class="gitscm-tab__deployment__commit-warning__msg">The | ||
{{ stratosProject.deploySource.branch }} | ||
branch has been updated since this app was deployed. Redeploy to update</div> | ||
</div> | ||
</div> | ||
<app-metadata-item label="Deployed:">{{ stratosProject.deploySource.timestamp * 1000 | date:'medium' }} | ||
</app-metadata-item> | ||
</div> | ||
<div class="gitscm-tab__deployment__commit-warning" *ngIf="!(isHead$ | async) && (initialised$ | async)"> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
<app-tile *ngIf="gitSCMRepo$ | async as gitSCMRepo"> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Repository Details</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<div> | ||
<div class="gitscm-tab__avatar"> | ||
<img src={{gitSCMRepo.owner.avatar_url}}> | ||
</div> | ||
<div> | ||
<app-metadata-item label="Full Name"> | ||
<div class="gitscm-tab__repo__name"> | ||
<a href="{{ gitSCMRepo.html_url }}" target="_blank">{{ gitSCMRepo.full_name }}</a> | ||
<mat-icon class="gitscm-tab__repo__name--icon" *ngIf="gitSCMRepo.private" | ||
matTooltip="Private Repo"> | ||
lock</mat-icon> | ||
</div> | ||
</app-metadata-item> | ||
<app-metadata-item label="Owner">{{ gitSCMRepo.owner.login || gitSCMRepo.owner.name }} | ||
</app-metadata-item> | ||
<app-metadata-item label="Description">{{ gitSCMRepo.description || '-' }}</app-metadata-item> | ||
<app-metadata-item label="Created:">{{ gitSCMRepo.created_at | date:'medium' }}</app-metadata-item> | ||
<app-metadata-item *ngIf="gitSCMRepo.pushed_at" label="Last Pushed:"> | ||
{{ gitSCMRepo.pushed_at | date:'medium' }}</app-metadata-item> | ||
<app-metadata-item *ngIf="gitSCMRepo.last_activity_at" label="Last Actvity:"> | ||
{{ gitSCMRepo.last_activity_at | date:'medium' }}</app-metadata-item> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
<app-tile *ngIf="commit$ | async as commitInfo"> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Commit Details</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<div> | ||
<div class="gitscm-tab__avatar"> | ||
<img src={{commitInfo.author.avatar_url}}> | ||
</div> | ||
<div> | ||
<mat-icon color="warn">warning</mat-icon> | ||
<app-metadata-item label="Message">{{ commitInfo.commit.message }}</app-metadata-item> | ||
<app-metadata-item label="SHA"> | ||
<a href={{commitInfo.html_url}} target="_blank">{{ commitInfo.sha | limitTo: 8}}</a> | ||
</app-metadata-item> | ||
<app-metadata-item label="Author"> | ||
<app-github-commit-author [commit]="commitInfo" [showAvatar]="false"></app-github-commit-author> | ||
</app-metadata-item> | ||
<app-metadata-item label="Date:">{{ commitInfo.commit.author.date | date:'medium' }} | ||
</app-metadata-item> | ||
</div> | ||
<div class="gitscm-tab__deployment__commit-warning__msg">The {{ stratosProject.deploySource.branch}} branch has been updated since this app was deployed. Redeploy to update</div> | ||
</div> | ||
</div> | ||
<app-metadata-item label="Deployed:">{{ stratosProject.deploySource.timestamp * 1000 | date:'medium' }}</app-metadata-item> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
<app-tile> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Repository Details</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
|
||
<div *ngIf="gitSCMRepo$ | async as gitSCMRepo"> | ||
<div class="gitscm-tab__avatar"> | ||
<img src={{gitSCMRepo.owner.avatar_url}}> | ||
</div> | ||
<div> | ||
<app-metadata-item label="Full Name"> | ||
<a href="{{ gitSCMRepo.html_url }}" target="_blank">{{ gitSCMRepo.full_name }}</a> | ||
</app-metadata-item> | ||
<app-metadata-item label="Owner">{{ gitSCMRepo.owner.login || gitSCMRepo.owner.name }}</app-metadata-item> | ||
<app-metadata-item label="Description">{{ gitSCMRepo.description }}</app-metadata-item> | ||
<app-metadata-item label="Created:">{{ gitSCMRepo.created_at | date:'medium' }}</app-metadata-item> | ||
<app-metadata-item *ngIf="gitSCMRepo.pushed_at" label="Last Pushed:">{{ gitSCMRepo.pushed_at | date:'medium' }}</app-metadata-item> | ||
<app-metadata-item *ngIf="gitSCMRepo.last_activity_at" label="Last Actvity:">{{ gitSCMRepo.last_activity_at | date:'medium' }}</app-metadata-item> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
<app-tile> | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>Commit Details</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<div *ngIf="commit$ | async as commitInfo"> | ||
<div class="gitscm-tab__avatar"> | ||
<img src={{commitInfo.author.avatar_url}}> | ||
</div> | ||
<div> | ||
<app-metadata-item label="Message">{{ commitInfo.commit.message }}</app-metadata-item> | ||
<app-metadata-item label="SHA"> | ||
<a href={{commitInfo.html_url}} target="_blank">{{ commitInfo.sha | limitTo: 8}}</a> | ||
</app-metadata-item> | ||
<app-metadata-item label="Author"> | ||
<app-github-commit-author [commit]="commitInfo" [showAvatar]="false"></app-github-commit-author> | ||
</app-metadata-item> | ||
<app-metadata-item label="Date:">{{ commitInfo.commit.author.date | date:'medium' }}</app-metadata-item> | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
</app-tile-group> | ||
<app-list *ngIf="gitSCMRepo$ | async as gitSCMRepo"></app-list> | ||
</app-tile-grid> | ||
</mat-card-content> | ||
</mat-card> | ||
</app-tile> | ||
</app-tile-group> | ||
<app-list *ngIf="gitSCMRepo$ | async as gitSCMRepo"></app-list> | ||
</app-tile-grid> | ||
<app-no-content-message *ngIf="(hasRepo$ | async) === false" [iconFont]="(icon$ | async)?.fontName" | ||
[icon]="(icon$ | async)?.iconName" [firstLine]="noContentFirstLine" [secondLine]="noContentSecondLine" | ||
[otherLines]="noContentOtherLines"> | ||
</app-no-content-message> | ||
</div> | ||
</app-loading-page> |
Oops, something went wrong.