gitlab-org--gitlab-foss/spec
Kamil Trzciński 51830b6659 Merge branch '22849-ci-build-ref-slug' into 'master'
Introduce $CI_BUILD_REF_SLUG

## What does this MR do?

Adds `$CI_BUILD_REF_SLUG` to the variables exposed to the runner. This is based on `$CI_BUILD_REF_NAME` but lowercased, shortened to 63 bytes maximum, and with characters invalid in URLs and domain names replaced with `-`. 

## Are there points in the code the reviewer needs to double check?

Slugs don't have a uniqueness guarantee. !7983 introduces an environment name slug which *is* unique, so I'm not as exercised about this as I was.

Should the slug be published in the API? It's available through the `variables` endpoint, but perhaps it should be part of `GET /project/:id/builds` ?

I've called it `ref_slug` rather than just `slug` as there are number of possibilities for slugification in a build (unlike an environment, where only the name makes sense to slugify).

## Why was this MR needed?

`$CI_BUILD_REF_NAME` is not suited for URLs and domain names, given the list of valid characters in a git ref. 

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [X] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
  - [X] Added for this feature/bug
  - [x] All builds are passing
- [X] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [X] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #22849

See merge request !8072
2016-12-15 11:08:27 +00:00
..
bin DRY up the specs for bin/changelog 2016-11-03 17:35:06 +00:00
config Make mail_room idle_timeout option configurable. 2016-11-16 12:46:37 +01:00
controllers Merge branch 'issue_13270' into 'master' 2016-12-13 11:43:15 +00:00
factories Introduce deployment services, starting with a KubernetesService 2016-12-14 21:06:26 +00:00
features Merge branch 'dz-fix-admin-routes' into 'master' 2016-12-14 15:09:54 +00:00
finders Merge branch '19990-update-snippets-page-design' into 'master' 2016-12-12 18:06:20 +00:00
fixtures adds impersonator variable and makes sudo usage overall more clear 2016-12-07 14:42:51 +00:00
helpers Merge branch 'html-safe-diff-line-content' into 'security' 2016-12-08 21:38:35 -03:00
initializers
javascripts Merge branch 'clean-no-undef' into 'master' 2016-12-15 00:52:46 +00:00
lib Introduce deployment services, starting with a KubernetesService 2016-12-14 21:06:26 +00:00
mailers Merge branch '24880-configurable-plaintext-emails' into 'master' 2016-11-29 12:05:23 +00:00
migrations Encode when migrating ProcessCommitWorker jobs 2016-12-13 16:52:49 +01:00
models Merge branch '22849-ci-build-ref-slug' into 'master' 2016-12-15 11:08:27 +00:00
policies Update effected tests 2016-12-04 17:32:33 +01:00
requests Fix wrong error message expectation in API::Commits spec 2016-12-14 09:26:19 +01:00
routing Add support for nested groups to admin routing 2016-12-11 10:30:10 +02:00
serializers fix transient timing failure adding timecop 2016-12-14 14:49:10 +01:00
services For single line git commit messages, the close quote should be on the same line as the open quote 2016-12-13 13:36:49 +01:00
support Merge branch 'grapify-service-api' into 'master' 2016-12-12 17:54:00 +00:00
tasks/gitlab Don't allow to specify a repo or version when installing Workhorse 2016-12-01 19:22:46 +01:00
uploaders
views Fix test 2016-12-12 13:16:52 -06:00
workers Merge branch 'zj-guest-reads-public-builds' into 'master' 2016-12-06 13:54:16 +00:00
factories_spec.rb
rails_helper.rb
rake_helper.rb Move task helpers to a module 2016-11-30 12:20:21 +01:00
simplecov_env.rb
spec_helper.rb Pass commit data to ProcessCommitWorker 2016-12-01 13:36:06 +01:00
teaspoon_env.rb