Commit 726c1181 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 9de8a305 f669331e
...@@ -11,6 +11,7 @@ import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphq ...@@ -11,6 +11,7 @@ import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphq
import getCommitSha from '../../graphql/queries/client/commit_sha.graphql'; import getCommitSha from '../../graphql/queries/client/commit_sha.graphql';
import getCurrentBranch from '../../graphql/queries/client/current_branch.graphql'; import getCurrentBranch from '../../graphql/queries/client/current_branch.graphql';
import getIsNewCiConfigFile from '../../graphql/queries/client/is_new_ci_config_file.graphql'; import getIsNewCiConfigFile from '../../graphql/queries/client/is_new_ci_config_file.graphql';
import getPipelineEtag from '../../graphql/queries/client/pipeline_etag.graphql';
import CommitForm from './commit_form.vue'; import CommitForm from './commit_form.vue';
...@@ -94,10 +95,15 @@ export default { ...@@ -94,10 +95,15 @@ export default {
}, },
update(store, { data }) { update(store, { data }) {
const commitSha = data?.commitCreate?.commit?.sha; const commitSha = data?.commitCreate?.commit?.sha;
const pipelineEtag = data?.commitCreate?.commit?.commitPipelinePath;
if (commitSha) { if (commitSha) {
store.writeQuery({ query: getCommitSha, data: { commitSha } }); store.writeQuery({ query: getCommitSha, data: { commitSha } });
} }
if (pipelineEtag) {
store.writeQuery({ query: getPipelineEtag, data: { pipelineEtag } });
}
}, },
}); });
......
...@@ -5,7 +5,11 @@ import { truncateSha } from '~/lib/utils/text_utility'; ...@@ -5,7 +5,11 @@ import { truncateSha } from '~/lib/utils/text_utility';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import getCommitSha from '~/pipeline_editor/graphql/queries/client/commit_sha.graphql'; import getCommitSha from '~/pipeline_editor/graphql/queries/client/commit_sha.graphql';
import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql'; import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql';
import { toggleQueryPollingByVisibility } from '~/pipelines/components/graph/utils'; import getPipelineEtag from '~/pipeline_editor/graphql/queries/client/pipeline_etag.graphql';
import {
getQueryHeaders,
toggleQueryPollingByVisibility,
} from '~/pipelines/components/graph/utils';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
const POLL_INTERVAL = 10000; const POLL_INTERVAL = 10000;
...@@ -31,7 +35,13 @@ export default { ...@@ -31,7 +35,13 @@ export default {
commitSha: { commitSha: {
query: getCommitSha, query: getCommitSha,
}, },
pipelineEtag: {
query: getPipelineEtag,
},
pipeline: { pipeline: {
context() {
return getQueryHeaders(this.pipelineEtag);
},
query: getPipelineQuery, query: getPipelineQuery,
variables() { variables() {
return { return {
......
...@@ -22,6 +22,7 @@ mutation commitCIFile( ...@@ -22,6 +22,7 @@ mutation commitCIFile(
commit { commit {
sha sha
} }
commitPipelinePath
errors errors
} }
} }
...@@ -6,6 +6,7 @@ import { resetServiceWorkersPublicPath } from '../lib/utils/webpack'; ...@@ -6,6 +6,7 @@ import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants'; import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants';
import getCommitSha from './graphql/queries/client/commit_sha.graphql'; import getCommitSha from './graphql/queries/client/commit_sha.graphql';
import getCurrentBranch from './graphql/queries/client/current_branch.graphql'; import getCurrentBranch from './graphql/queries/client/current_branch.graphql';
import getPipelineEtag from './graphql/queries/client/pipeline_etag.graphql';
import { resolvers } from './graphql/resolvers'; import { resolvers } from './graphql/resolvers';
import typeDefs from './graphql/typedefs.graphql'; import typeDefs from './graphql/typedefs.graphql';
import PipelineEditorApp from './pipeline_editor_app.vue'; import PipelineEditorApp from './pipeline_editor_app.vue';
...@@ -26,6 +27,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ...@@ -26,6 +27,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
// Add to apollo cache as it can be updated by future queries // Add to apollo cache as it can be updated by future queries
commitSha, commitSha,
initialBranchName, initialBranchName,
pipelineEtag,
// Add to provide/inject API for static values // Add to provide/inject API for static values
ciConfigPath, ciConfigPath,
defaultBranch, defaultBranch,
...@@ -48,7 +50,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ...@@ -48,7 +50,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
Vue.use(VueApollo); Vue.use(VueApollo);
const apolloProvider = new VueApollo({ const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(resolvers, { typeDefs }), defaultClient: createDefaultClient(resolvers, { typeDefs, useGet: true }),
}); });
const { cache } = apolloProvider.clients.defaultClient; const { cache } = apolloProvider.clients.defaultClient;
...@@ -66,6 +68,13 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ...@@ -66,6 +68,13 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
}, },
}); });
cache.writeQuery({
query: getPipelineEtag,
data: {
pipelineEtag,
},
});
return new Vue({ return new Vue({
el, el,
apolloProvider, apolloProvider,
......
...@@ -9,14 +9,16 @@ module Ci ...@@ -9,14 +9,16 @@ module Ci
end end
def js_pipeline_editor_data(project) def js_pipeline_editor_data(project)
commit_sha = project.commit ? project.commit.sha : ''
{ {
"ci-config-path": project.ci_config_path_or_default, "ci-config-path": project.ci_config_path_or_default,
"commit-sha" => project.commit ? project.commit.sha : '', "commit-sha" => commit_sha,
"default-branch" => project.default_branch, "default-branch" => project.default_branch,
"empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'), "empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'),
"initial-branch-name": params[:branch_name], "initial-branch-name": params[:branch_name],
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'), "lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'),
"new-merge-request-path" => namespace_project_new_merge_request_path, "new-merge-request-path" => namespace_project_new_merge_request_path,
"pipeline_etag" => graphql_etag_pipeline_sha_path(project.commit.sha),
"project-path" => project.path, "project-path" => project.path,
"project-full-path" => project.full_path, "project-full-path" => project.full_path,
"project-namespace" => project.namespace.full_path, "project-namespace" => project.namespace.full_path,
......
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
%span.light= _('External User:') %span.light= _('External User:')
%strong %strong
= @user.external? ? _('Yes') : _('No') = @user.external? ? _('Yes') : _('No')
= render_if_exists 'admin/users/provisioned_by', user: @user
%li %li
%span.light= _('Can create groups:') %span.light= _('Can create groups:')
%strong %strong
......
---
title: Fix regression in GraphQL field MergeRequest.assignees.webUrl
merge_request: 60428
author:
type: fixed
...@@ -338,7 +338,6 @@ that suggests checking that the app manifest contains these settings: ...@@ -338,7 +338,6 @@ that suggests checking that the app manifest contains these settings:
- `"accessTokenAcceptedVersion": null` - `"accessTokenAcceptedVersion": null`
- `"signInAudience": "AzureADMyOrg"` - `"signInAudience": "AzureADMyOrg"`
1. `"signInAudience": "AzureADMyOrg"`
Note that this configuration corresponds with the `Supported account types` setting used when creating the `IdentityExperienceFramework` app. Note that this configuration corresponds with the `Supported account types` setting used when creating the `IdentityExperienceFramework` app.
......
- provisioning_group = @user.provisioned_by_group
- return unless provisioning_group
%li
%span.light
= _("Provisioned by:")
%strong
= link_to provisioning_group.name, admin_group_path(provisioning_group)
%span.light
= '(%{gid})' % {gid: provisioning_group.id}
---
title: Add provisioned by group info in user admin
merge_request: 60315
author:
type: added
...@@ -10,14 +10,14 @@ module Gitlab ...@@ -10,14 +10,14 @@ module Gitlab
end end
def self.presenter_class def self.presenter_class
@presenter_class @presenter_class || superclass.try(:presenter_class)
end end
def self.present(object, attrs) def self.present(object, attrs)
klass = @presenter_class klass = presenter_class
return object if !klass || object.is_a?(klass) return object if !klass || object.is_a?(klass)
@presenter_class.new(object, **attrs) klass.new(object, **attrs)
end end
end end
......
...@@ -26155,6 +26155,9 @@ msgstr "" ...@@ -26155,6 +26155,9 @@ msgstr ""
msgid "Provider" msgid "Provider"
msgstr "" msgstr ""
msgid "Provisioned by:"
msgstr ""
msgid "Proxy support for this API is not available currently" msgid "Proxy support for this API is not available currently"
msgstr "" msgstr ""
......
...@@ -45,6 +45,7 @@ RSpec.describe Ci::PipelineEditorHelper do ...@@ -45,6 +45,7 @@ RSpec.describe Ci::PipelineEditorHelper do
"initial-branch-name": nil, "initial-branch-name": nil,
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'), "lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'),
"new-merge-request-path" => '/mock/project/-/merge_requests/new', "new-merge-request-path" => '/mock/project/-/merge_requests/new',
"pipeline_etag" => graphql_etag_pipeline_sha_path(project.commit.sha),
"project-path" => project.path, "project-path" => project.path,
"project-full-path" => project.full_path, "project-full-path" => project.full_path,
"project-namespace" => project.namespace.full_path, "project-namespace" => project.namespace.full_path,
......
...@@ -63,6 +63,16 @@ RSpec.describe Gitlab::Graphql::Present::FieldExtension do ...@@ -63,6 +63,16 @@ RSpec.describe Gitlab::Graphql::Present::FieldExtension do
expect(value).to eq 'made of concrete' expect(value).to eq 'made of concrete'
end end
context 'when the implementation is inherited' do
it 'resolves the interface field using the implementation from the presenter' do
subclass = Class.new(implementation) { graphql_name 'Subclass' }
field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::STRING_TYPE, null: true, owner: interface)
value = resolve_field(field, object, object_type: subclass)
expect(value).to eq 'made of concrete'
end
end
end end
describe 'interactions with inheritance' do describe 'interactions with inheritance' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment