Skip to content
代码片段 群组 项目
未验证 提交 f4194e1f 编辑于 作者: Jose Ivan Vargas's avatar Jose Ivan Vargas 提交者: GitLab
浏览文件

Merge branch 'ph/widgetPipelinePollingFix' into 'master'

Remove pipeline from widget GraphQL request

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167161



Merged-by: default avatarJose Ivan Vargas <jvargas@gitlab.com>
Approved-by: default avatarJose Ivan Vargas <jvargas@gitlab.com>
Co-authored-by: default avatarPhil Hughes <me@iamphill.com>
No related branches found
No related tags found
无相关合并请求
......@@ -20,12 +20,6 @@ query getState($projectPath: ID!, $iid: String!) {
mergeStatus
mergeable
mergeableDiscussionsState
headPipeline {
id
iid
status
warnings
}
shouldBeRebased
sourceBranchExists
state
......
......@@ -141,6 +141,7 @@ export default class MergeRequestStore {
this.isPipelineSkipped = this.ciStatus === 'skipped';
this.pipelineDetailedStatus = pipelineStatus;
this.isPipelineActive = data.pipeline ? data.pipeline.active : false;
this.pipelineIid = data.pipeline?.iid;
this.isPipelineBlocked =
data.only_allow_merge_if_pipeline_succeeds && pipelineStatus?.group === 'manual';
this.faviconOverlayPath = data.favicon_overlay_path;
......@@ -181,7 +182,6 @@ export default class MergeRequestStore {
setGraphqlData(project) {
const { mergeRequest } = project;
const pipeline = mergeRequest.headPipeline;
this.updateStatusState(mergeRequest.state);
......@@ -193,11 +193,6 @@ export default class MergeRequestStore {
this.autoMergeEnabled = mergeRequest.autoMergeEnabled;
this.canBeMerged = mergeRequest.mergeStatus === 'can_be_merged';
this.canMerge = mergeRequest.userPermissions.canMerge;
this.ciStatus = pipeline?.status.toLowerCase();
if (pipeline?.warnings && this.ciStatus === 'success') {
this.ciStatus = `${this.ciStatus}-with-warnings`;
}
this.commitsCount = mergeRequest.commitCount;
this.branchMissing =
......@@ -213,7 +208,6 @@ export default class MergeRequestStore {
this.draft = mergeRequest.draft;
this.mergeRequestState = mergeRequest.state;
this.detailedMergeStatus = mergeRequest.detailedMergeStatus;
this.pipelineIid = pipeline?.iid;
this.setState();
}
......
......@@ -4,6 +4,7 @@ class MergeRequests::PipelineEntity < Grape::Entity
include RequestAwareEntity
expose :id
expose :iid
expose :active?, as: :active
expose :name
......
......@@ -347,7 +347,7 @@ describe('MrWidgetOptions', () => {
jest.spyOn(notify, 'notifyMe').mockImplementation(() => {});
const logoFilename = 'logo.png';
await createComponent({
updatedMrData: { gitlabLogo: logoFilename },
updatedMrData: { gitlabLogo: logoFilename, ci_status: 'failed' },
});
eventHub.$emit('MRWidgetUpdateRequested');
await waitForPromises();
......@@ -522,10 +522,10 @@ describe('MrWidgetOptions', () => {
beforeEach(() => {
mock
.onGet(mockData.merge_request_widget_path)
.reply(HTTP_STATUS_OK, { ...mockData, ...updatedMrData });
.reply(HTTP_STATUS_OK, { ...mockData, ...updatedMrData, ci_status: 'failed' });
mock
.onGet(mockData.merge_request_cached_widget_path)
.reply(HTTP_STATUS_OK, { ...mockData, ...updatedMrData });
.reply(HTTP_STATUS_OK, { ...mockData, ...updatedMrData, ci_status: 'failed' });
});
it('should call notifyMe', async () => {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册