Commit 1635eacd authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 5b51129e
......@@ -24,10 +24,10 @@ export default {
},
lastCrumb() {
const { children } = last(this.crumbs);
const { tagName, classList } = first(children);
const { tagName, className } = first(children);
return {
tagName,
classList: [...classList],
className,
text: this.$route.meta.nameGenerator(this.$route),
path: { to: this.$route.name },
};
......@@ -41,7 +41,7 @@ export default {
<li
v-for="(crumb, index) in rootCrumbs"
:key="index"
:class="crumb.classList"
:class="crumb.className"
v-html="crumb.innerHTML"
></li>
<li v-if="!isRootRoute">
......@@ -51,7 +51,7 @@ export default {
<component :is="divider.tagName" :class="divider.classList" v-html="divider.innerHTML" />
</li>
<li>
<component :is="lastCrumb.tagName" ref="lastCrumb" :class="lastCrumb.classList">
<component :is="lastCrumb.tagName" ref="lastCrumb" :class="lastCrumb.className">
<router-link ref="childRouteLink" :to="lastCrumb.path">{{ lastCrumb.text }}</router-link>
</component>
</li>
......
......@@ -21,7 +21,9 @@ export default function createRouter(base, store) {
root: true,
},
beforeEnter: (to, from, next) => {
store.dispatch('requestImagesList');
if (!from.name || !store.state.images?.length) {
store.dispatch('requestImagesList');
}
next();
},
},
......
......@@ -51,12 +51,16 @@ We need to make Docker Registry send notification events to the
'threshold' => 5,
'backoff' => '1s',
'headers' => {
'Authorization' => ['<replace_with_a_secret_token>'] # An alphanumeric string. Case sensitive and must start with a letter.
'Authorization' => ['<replace_with_a_secret_token>']
}
}
]
```
NOTE: **Note:**
Replace `<replace_with_a_secret_token>` with a case sensitive alphanumeric string
that starts with a letter. You can generate one with `< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c 32 | sed "s/^[0-9]*//"; echo`
NOTE: **Note:**
If you use an external Registry (not the one integrated with GitLab), you must add
these settings to its configuration yourself. In this case, you will also have to specify
......
......@@ -35,9 +35,9 @@ of the client doing compilation of queries.
To distinguish queries from mutations and fragments, the following naming convention is recommended:
- `allUsers.query.graphql` for queries;
- `addUser.mutation.graphql` for mutations;
- `basicUser.fragment.graphql` for fragments.
- `all_users.query.graphql` for queries;
- `add_user.mutation.graphql` for mutations;
- `basic_user.fragment.graphql` for fragments.
### Fragments
......@@ -56,8 +56,8 @@ fragment DesignListItem on Design {
Fragments can be stored in separate files, imported and used in queries, mutations, or other fragments.
```javascript
#import "./designList.fragment.graphql"
#import "./diffRefs.fragment.graphql"
#import "./design_list.fragment.graphql"
#import "./diff_refs.fragment.graphql"
fragment DesignItem on Design {
...DesignListItem
......@@ -258,6 +258,42 @@ export default {
};
```
### Manually triggering queries
Queries on a component's `apollo` property are made automatically when the component is created.
Some components instead want the network request made on-demand, for example a dropdown with lazy-loaded items.
There are two ways to do this:
1. Use the `skip` property
```javascript
export default {
apollo: {
user: {
query: QUERY_IMPORT,
skip() {
// only make the query when dropdown is open
return !this.isOpen;
},
}
},
};
```
1. Using `addSmartQuery`
You can manually create the Smart Query in your method.
```javascript
handleClick() {
this.$apollo.addSmartQuery('user', {
// this takes the same values as you'd have in the `apollo` section
query: QUERY_IMPORT,
}),
};
```
### Working with pagination
GitLab's GraphQL API uses [Relay-style cursor pagination](https://www.apollographql.com/docs/react/data/pagination/#cursor-based)
......
......@@ -763,7 +763,7 @@ You must use a Kubernetes network plugin that implements support for
`NetworkPolicy`. The default network plugin for Kubernetes (`kubenet`)
[does not implement](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#kubenet)
support for it. The [Cilium](https://cilium.io/) network plugin can be
installed as a [cluster application](../../user/clusters/applications.md#install-cilium-using-gitlab-ci)
installed as a [cluster application](../../user/clusters/applications.md#install-cilium-using-gitlab-cicd)
to enable support for network policies.
You can enable deployment of a network policy by setting the following
......@@ -799,7 +799,7 @@ networkPolicy:
```
For more information on how to install Network Policies, see
[Install Cilium using GitLab CI](../../user/clusters/applications.md#install-cilium-using-gitlab-ci).
[Install Cilium using GitLab CI](../../user/clusters/applications.md#install-cilium-using-gitlab-cicd).
#### Web Application Firewall (ModSecurity) customization
......
......@@ -529,7 +529,7 @@ Interested in contributing a new GitLab managed app? Visit the
[development guidelines page](../../development/kubernetes.md#gitlab-managed-apps)
to get started.
## Install using GitLab CI (alpha)
## Install using GitLab CI/CD (alpha)
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20822) in GitLab 12.6.
......@@ -538,20 +538,20 @@ This is an _alpha_ feature, and it is subject to change at any time without
prior notice.
This alternative method allows users to install GitLab-managed
applications using GitLab CI. It also allows customization of the
applications using GitLab CI/CD. It also allows customization of the
install using Helm `values.yaml` files.
Supported applications:
- [Ingress](#install-ingress-using-gitlab-ci)
- [cert-manager](#install-cert-manager-using-gitlab-ci)
- [Sentry](#install-sentry-using-gitlab-ci)
- [GitLab Runner](#install-gitlab-runner-using-gitlab-ci)
- [Cilium](#install-cilium-using-gitlab-ci)
- [Vault](#install-vault-using-gitlab-ci)
- [JupyterHub](#install-jupyterhub-using-gitlab-ci)
- [Elastic Stack](#install-elastic-stack-using-gitlab-ci)
- [Crossplane](#install-crossplane-using-gitlab-ci)
- [Ingress](#install-ingress-using-gitlab-cicd)
- [cert-manager](#install-cert-manager-using-gitlab-cicd)
- [Sentry](#install-sentry-using-gitlab-cicd)
- [GitLab Runner](#install-gitlab-runner-using-gitlab-cicd)
- [Cilium](#install-cilium-using-gitlab-cicd)
- [Vault](#install-vault-using-gitlab-cicd)
- [JupyterHub](#install-jupyterhub-using-gitlab-cicd)
- [Elastic Stack](#install-elastic-stack-using-gitlab-cicd)
- [Crossplane](#install-crossplane-using-gitlab-cicd)
### Usage
......@@ -559,7 +559,7 @@ You can find and import all the files referenced below
in the [example cluster applications
project](https://gitlab.com/gitlab-org/cluster-integration/example-cluster-applications/).
To install applications using GitLab CI:
To install applications using GitLab CI/CD:
1. Connect the cluster to a [cluster management project](management_project.md).
1. In that project, add a `.gitlab-ci.yml` file with the following content:
......@@ -582,7 +582,7 @@ To install applications using GitLab CI:
1. Optionally, define `.gitlab/managed-apps/<application>/values.yaml` file to
customize values for the installed application.
A GitLab CI pipeline will then run on the `master` branch to install the
A GitLab CI/CD pipeline will then run on the `master` branch to install the
applications you have configured. In case of pipeline failure, the
output of the [Helm
Tiller](https://v2.helm.sh/docs/install/#running-tiller-locally) binary
......@@ -597,7 +597,7 @@ Note the following:
- If you update `.gitlab/managed-apps/<application>/values.yaml` with new values, the
application will be redeployed.
### Install Ingress using GitLab CI
### Install Ingress using GitLab CI/CD
To install Ingress, define the `.gitlab/managed-apps/config.yaml` file
with:
......@@ -616,9 +616,9 @@ management project. Refer to the
[chart](https://github.com/helm/charts/tree/master/stable/nginx-ingress)
for the available configuration options.
### Install cert-manager using GitLab CI
### Install cert-manager using GitLab CI/CD
cert-manager is installed using GitLab CI by defining configuration in
cert-manager is installed using GitLab CI/CD by defining configuration in
`.gitlab/managed-apps/config.yaml`.
cert-manager:
......@@ -628,7 +628,7 @@ cert-manager:
email address to be specified. The email address is used by Let's Encrypt to
contact you about expiring certificates and issues related to your account.
The following configuration is required to install cert-manager using GitLab CI:
The following configuration is required to install cert-manager using GitLab CI/CD:
```yaml
certManager:
......@@ -638,7 +638,7 @@ certManager:
email: "user@example.com"
```
The following installs cert-manager using GitLab CI without the default `ClusterIssuer`:
The following installs cert-manager using GitLab CI/CD without the default `ClusterIssuer`:
```yaml
certManager:
......@@ -653,7 +653,7 @@ management project. Refer to the
[chart](https://hub.helm.sh/charts/jetstack/cert-manager) for the
available configuration options.
### Install Sentry using GitLab CI
### Install Sentry using GitLab CI/CD
NOTE: **Note:**
The Sentry Helm chart [recommends](https://github.com/helm/charts/blob/f6e5784f265dd459c5a77430185d0302ed372665/stable/sentry/values.yaml#L284-L285) at least 3GB of available RAM for database migrations.
......@@ -714,12 +714,12 @@ postgresql:
postgresqlPassword: example-postgresql-password
```
### Install GitLab Runner using GitLab CI
### Install GitLab Runner using GitLab CI/CD
GitLab Runner is installed using GitLab CI by defining configuration in
GitLab Runner is installed using GitLab CI/CD by defining configuration in
`.gitlab/managed-apps/config.yaml`.
The following configuration is required to install GitLab Runner using GitLab CI:
The following configuration is required to install GitLab Runner using GitLab CI/CD:
```yaml
gitlabRunner:
......@@ -745,7 +745,7 @@ management project. Refer to the
[chart](https://gitlab.com/gitlab-org/charts/gitlab-runner) for the
available configuration options.
### Install Cilium using GitLab CI
### Install Cilium using GitLab CI/CD
> [Introduced](https://gitlab.com/gitlab-org/cluster-integration/cluster-applications/-/merge_requests/22) in GitLab 12.8.
......@@ -823,14 +823,14 @@ agent:
enabled: false
```
### Install Vault using GitLab CI
### Install Vault using GitLab CI/CD
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9982) in GitLab 12.9.
[Hashicorp Vault](https://vaultproject.io/) is a secrets management solution which
can be used to safely manage and store passwords, credentials, certificates and more. A Vault
installation could be leveraged to provide a single secure data store for credentials
used in your applications, GitLab CI jobs, and more. It could also serve as a way of
used in your applications, GitLab CI/CD jobs, and more. It could also serve as a way of
providing SSL/TLS certificates to systems and deployments in your infrastructure. Leveraging
Vault as a single source for all these credentials allows greater security by having
a single source of access, control, and auditability around all your sensitive
......@@ -912,11 +912,11 @@ kubectl -n gitlab-managed-apps exec -it vault-0 sh
This should give you your unseal keys and initial root token. Make sure to note these down
and keep these safe as you will need them to unseal the Vault throughout its lifecycle.
### Install JupyterHub using GitLab CI
### Install JupyterHub using GitLab CI/CD
> [Introduced](https://gitlab.com/gitlab-org/cluster-integration/cluster-applications/-/merge_requests/40) in GitLab 12.8.
JupyterHub is installed using GitLab CI by defining configuration in
JupyterHub is installed using GitLab CI/CD by defining configuration in
`.gitlab/managed-apps/config.yaml` as follows:
```yaml
......@@ -961,14 +961,14 @@ Refer to the
[chart reference](https://zero-to-jupyterhub.readthedocs.io/en/stable/reference.html) for the
available configuration options.
### Install Elastic Stack using GitLab CI
### Install Elastic Stack using GitLab CI/CD
> [Introduced](https://gitlab.com/gitlab-org/cluster-integration/cluster-applications/-/merge_requests/45) in GitLab 12.8.
Elastic Stack is installed using GitLab CI by defining configuration in
Elastic Stack is installed using GitLab CI/CD by defining configuration in
`.gitlab/managed-apps/config.yaml`.
The following configuration is required to install Elastic Stack using GitLab CI:
The following configuration is required to install Elastic Stack using GitLab CI/CD:
```yaml
elasticStack:
......@@ -988,14 +988,14 @@ available configuration options.
NOTE: **Note:**
In this alpha implementation of installing Elastic Stack through CI, reading the environment logs through Elasticsearch is unsupported. This is supported if [installed via the UI](#elastic-stack).
### Install Crossplane using GitLab CI
### Install Crossplane using GitLab CI/CD
> [Introduced](https://gitlab.com/gitlab-org/cluster-integration/cluster-applications/-/merge_requests/68) in GitLab 12.9.
Crossplane is installed using GitLab CI by defining configuration in
Crossplane is installed using GitLab CI/CD by defining configuration in
`.gitlab/managed-apps/config.yaml`.
The following configuration is required to install Crossplane using GitLab CI:
The following configuration is required to install Crossplane using GitLab CI/CD:
```yaml
Crossplane:
......
......@@ -14,7 +14,7 @@ privileges.
This can be useful for:
- Creating pipelines to install cluster-wide applications into your cluster, see [Install using GitLab CI (alpha)](applications.md#install-using-gitlab-ci-alpha) for details.
- Creating pipelines to install cluster-wide applications into your cluster, see [Install using GitLab CI/CD (alpha)](applications.md#install-using-gitlab-cicd-alpha) for details.
- Any jobs that require `cluster-admin` privileges.
## Permissions
......
......@@ -10,7 +10,7 @@ Error tracking allows developers to easily discover and view the errors that the
### Deploying Sentry
You may sign up to the cloud hosted <https://sentry.io>, deploy your own [on-premise instance](https://docs.sentry.io/server/installation/) or use GitLab to [install Sentry to a Kubernetes cluster](../../clusters/applications.md#install-sentry-using-gitlab-ci).
You may sign up to the cloud hosted <https://sentry.io>, deploy your own [on-premise instance](https://docs.sentry.io/server/installation/) or use GitLab to [install Sentry to a Kubernetes cluster](../../clusters/applications.md#install-sentry-using-gitlab-cicd).
### Enabling Sentry
......
......@@ -149,12 +149,36 @@ describe 'Container Registry', :js do
end
it('pagination navigate to the second page') do
pagination = find('.gl-pagination')
pagination.click_link('2')
visit_second_page
expect(page).to have_content '20'
end
end
end
context 'when there are more than 10 images' do
before do
create_list(:container_repository, 12, project: project)
project.container_repositories << container_repository
visit_container_registry
end
it 'shows pagination' do
expect(page).to have_css '.gl-pagination'
end
it 'pagination goes to second page' do
visit_second_page
expect(page).to have_content 'my/image'
end
it 'pagination is preserved after navigating back from details' do
visit_second_page
click_link 'my/image'
breadcrumb = find '.breadcrumbs'
breadcrumb.click_link 'Container Registry'
expect(page).to have_content 'my/image'
end
end
end
def visit_container_registry
......@@ -163,6 +187,11 @@ describe 'Container Registry', :js do
def visit_container_registry_details(name)
visit_container_registry
click_link(name)
click_link name
end
def visit_second_page
pagination = find '.gl-pagination'
pagination.click_link '2'
end
end
......@@ -7,14 +7,14 @@ describe('Registry Breadcrumb', () => {
const nameGenerator = jest.fn();
const crumb = {
classList: ['foo', 'bar'],
className: 'foo bar',
tagName: 'div',
innerHTML: 'baz',
querySelector: jest.fn(),
children: [
{
tagName: 'a',
classList: ['foo'],
className: 'foo',
},
],
};
......@@ -25,7 +25,7 @@ describe('Registry Breadcrumb', () => {
innerHTML: 'foo',
};
const crumbs = [crumb, { ...crumb, innerHTML: 'foo' }, { ...crumb, classList: ['baz'] }];
const crumbs = [crumb, { ...crumb, innerHTML: 'foo' }, { ...crumb, className: 'baz' }];
const routes = [
{ name: 'foo', meta: { nameGenerator, root: true } },
......@@ -121,7 +121,11 @@ describe('Registry Breadcrumb', () => {
});
it('has the same classes as the last children of the crumbs', () => {
expect(findLastCrumb().classes()).toEqual(lastChildren.classList);
expect(
findLastCrumb()
.classes()
.join(' '),
).toEqual(lastChildren.className);
});
it('has a link to the current route', () => {
......
......@@ -23,7 +23,12 @@ describe 'gitlab:app namespace rake task' do
end
before(:all) do
Rails.application.load_tasks
Rake.application.rake_require 'active_record/railties/databases'
Rake.application.rake_require 'tasks/gitlab/helpers'
Rake.application.rake_require 'tasks/gitlab/backup'
Rake.application.rake_require 'tasks/gitlab/shell'
Rake.application.rake_require 'tasks/gitlab/db'
Rake.application.rake_require 'tasks/cache'
# empty task as env is already loaded
Rake::Task.define_task :environment
......
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