Commit Graph
679 Commits
Author SHA1 Message Date
Kamil Trzcinski dda94e0406 Make project_id nullable 2016-06-16 10:43:47 +02:00
Rémy Coutable b4ed272da9 Add index on requested_at to the members table
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-15 16:56:26 +02:00
Rémy Coutable be09845914 Merge branch 'environments-and-deployments' into 'master'
Add environments and deployments

This MR is a continuation of https://gitlab.com/gitlab-org/gitlab-ce/issues/17009.

The current implementation is as follow:
1. We have two new tables: `environments` and `deployments`.
2. We have a new tab: `Environments` under `Pipelines` where you can see all you environments and add a new one.
3. We add a new option to `.gitlab-ci.yml` to track where we should create a deployment for environment.
4. If environment in `.gitlab-ci.yml` is specified it will create a deployment. **If environment does not exist it will be created.** (this got changed)
5. The deployment is always successful and shows the time of the action, in that case a build that presumably should do deployment. In the future we could extend deployment with statuses: success, failure. We could extend deployments with information that this is partial or full deployment.
6. User have to create environments that he will track first.
7. User can remove environments.
8. User can retry/rollback past deployment (in that case we retry past build). The new build when succeeds it will create a new deployment.
9. Currently environment have only one parameter: `name`. In the future it should have: `variables`, `credentials` and possibly `runners` and maybe other resources.
10. Currently deployment have this parameters: `sha`, `ref`, `deployable (in this case a build)`, `user (who triggered a deployment)`, `created_at`.

The `.gitlab-ci.yml`:
```
deploy to production:
  stage: deploy
  script: dpl travis...
  environment: production
```

What needs to be done:
- [x] Write initial implementation
- [x] Improve implementation (@ayufan)
- [x] Write tests (@ayufan)
- [x] Improve UX of the forms (cc @markpundsack) - reviewed by @markpundsack
- [x] Improve implementation of the views (cc @jschatz1) - done by @iamphill 
- [x] Write .gitlab-ci.yml documentation for `environments` - done by @ayufan
- [ ] Write user documentation (@ayufan and @markpundsack)

See merge request !4605
2016-06-15 13:48:09 +00:00
Kamil Trzcinski a4dc5f79bf Make project_id, iid unique for deployments 2016-06-15 14:05:26 +02:00
Kamil Trzcinski 9e487100b5 Validate project and environment instead of only requiring 2016-06-15 14:05:10 +02:00
Kamil Trzcinski 14433b341d Make project_id and environment_id nullable
This is done to make belongs_to with required to properly validate association.
Otherwise `ActiveRecord::StatementInvalid` is raised.
2016-06-15 13:00:13 +02:00
Kamil Trzcinski 2541e50d7c Improve validations 2016-06-15 12:03:49 +02:00
Douwe Maan 9413d1c2e9 Merge branch 'master' into 13948-access-request-to-projects-and-groups
# Conflicts:
#	app/views/layouts/nav/_project.html.haml
2016-06-14 16:23:16 +02:00
Kamil Trzcinski 006b650988 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	db/schema.rb
2016-06-14 16:19:29 +02:00
Rémy Coutable 95a7fbe97c Merge branch 'artifacts-expire-date' into 'master'
Artifacts expire date

What do you think @grzesiek?

The syntax will be simple:
```
job:
  artifacts:
    expire_in: 7d
```

- [x] Implement `expire_in`
- [x] Check current design of expiry information with @jschatz1 and @markpundsack 
- [x] Add tests in GitLab application for a `ExpireBuildArtifactsWorker` and for `ArtifactsController::keep`
- [x] Add user documentation how to use `artifacts:expire_in`
- [x] Prepare GitLab Runner changes to pass `expire_in`: gitlab-org/gitlab-ci-multi-runner!191
- [x] Fix `timeago` with help of @jschatz1
- [x] Merge latest master after builds view changes @iamphill
- [ ] Add Omnibus support for `expire_build_artifacts_worker` cron job
- [ ] Add documentation how to configure `expire_build_artifacts_worker`

This is based on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4201.

See merge request !4200
2016-06-14 13:40:01 +00:00
Kamil Trzcinski 3ade826065 Add specs for models and services 2016-06-14 13:51:12 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Kamil Trzcinski 7d9e8b04c0 Merge remote-tracking branch 'origin/master' into environments-and-deployments 2016-06-14 12:41:18 +02:00
Yorick Peterse c6744b4949 Fixed locking syntax for PostgreSQL 2016-06-14 12:19:38 +02:00
Yorick Peterse d032c6b0ff Move LOCK TABLES to a separate execute
MySQL apparently doesn't support executing multiple queries in the same
`execute` call so we have to use a separate one for the "LOCK TABLES"
statement.
2016-06-14 12:19:38 +02:00
Z.J. van de WegandYorick Peterse fc5b3a8fa5 Fix MySQL migration, obtain lock the right way
As suggested by @yorrickpeterse in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4581#note_12373882
the locking of the MySQL database wasn't correct.
2016-06-14 12:19:38 +02:00
Z.J. van de WegandYorick Peterse f8290c2862 Fix timing issues on convertion migration award emoji
This commit does two things:
1. It adds logic which prevents timing issues when running the
migration. During the migration, notes can be created which _should_
be award emoji and thus migrated. To prevent these timing issues, a
lock is obtained on the table (MySQL) or on Transaction level (PG).
2. There was no down migration before as you'd probably lose some data.
Data effected is all awards on notes. These could be migrated back, as
the noteable type would just be Note, though this would litter the DB
with data which should not be there. This down migration does not yet
delete the table.
2016-06-14 12:19:38 +02:00
David AlexanderandRémy Coutable 17c22156c5 Initial implementation of user access request to projects 2016-06-14 12:12:02 +02:00
Kamil Trzcinski 1b62b86fdd Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-14 11:38:44 +02:00
Douglas Barbosa Alexandre 0568b90c97 Remove deprecated issues_tracker and issues_tracker_id from project 2016-06-13 18:13:55 -03:00
Kamil Trzcinski f6de5937e3 Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-13 16:05:30 +02:00
Douwe Maan c03f125904 Merge branch 'issue_3359_2' into 'master'
Remove notification level from user model

part of #3359 

See merge request !4494
2016-06-13 11:52:39 +00:00
Kamil TrzcinskiandPhil Hughes aea4041ce9 Allow to expire build artifacts 2016-06-13 11:01:19 +01:00
Kamil Trzcinski 907c0e6796 Added initial version of deployments 2016-06-10 23:36:54 +02:00
Felipe Artur 39ead205de Remove notification level fild from users, improve migrations and specs 2016-06-10 11:49:30 -03:00
Felipe Artur 8f6d43e0fe Remove notification level from user model 2016-06-10 10:58:13 -03:00
Paco GuzmanandYorick Peterse 136a4ea39b Cache the presence of an issue_tracker at project level
Using update_column to store the boolean flag to avoid
any side effects with the current state of the project
instance
2016-06-10 15:41:56 +02:00
Rui AndersonandRémy Coutable 07dbd6b388 Allow or not merge MR with failed build
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-10 14:36:54 +02:00
Sean McGivern 98bb435f42 Enable RuboCop for migrations
Migrations shouldn't fail RuboCop checks - especially lint checks, such
as the nested method check. To avoid changing code in existing
migrations, add the magic comment to the top of each of them to skip
that file.
2016-06-09 16:05:25 +01:00
Sean McGivern 40b6d9064a Allow custom text on 'almost there' page
Add a new application setting, after_sign_up_text. This is text to be
rendered as Markdown and shown on the 'almost there' page after a user
signs up, but before they've confirmed their account.

Tweak the styles for that page so that centered lists look reasonable.
2016-06-08 19:08:53 +01:00
Yorick Peterse 3883bc05d2 Remove notification settings in batches
This improves performance of the duplicate notification settings
migration by removing duplicates in batches instead of using one big
"DELETE FROM" query.

The previous query would locally run over 45 minutes without even
finishing. This new setup finished in a matter of seconds.

Fixes #18289
2016-06-08 16:20:42 +02:00
Jacob Schatz 5b83abcc01 Merge branch 'issue_14189' into 'master'
Ability to prioritize labels

Closes #14189 

See merge request !4009
2016-06-07 15:15:07 +00:00
Yorick Peterse 0ba21860c5 Merge branch 'issue_3359' into 'master'
Remove duplicated notification settings and add unique index

See merge request !4472
2016-06-06 19:14:01 +00:00
Thijs WoutersandAlfredo Sumaran d8263b2851 Sort by label priority
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-06 11:59:49 -05:00
Timothy Andrew 791cc9138b Add a U2fRegistrations table/model.
- To hold registrations from U2F devices, and to authenticate them.
- Previously, `User#two_factor_enabled` was aliased to the
  `otp_required_for_login` column on `users`.
- This commit changes things a bit:
    - `User#two_factor_enabled` is not a method anymore
    - `User#two_factor_enabled?` checks both the
      `otp_required_for_login` column, as well as `U2fRegistration`s
    - Change all instances of `User#two_factor_enabled` to
      `User#two_factor_enabled?`
- Add the `u2f` gem, and implement registration/authentication at the
  model level.
2016-06-06 12:50:31 +05:30
Felipe Artur 8450fe3074 Add index to notification settings 2016-06-03 16:46:10 -03:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Z.J. van de Weg 91a7b9333b Incorportate feedback 2016-06-01 12:10:08 +02:00
Stan Hu e87149a12b Merge branch 'remove-dangling-notification-settings' into 'master'
Remove project notification settings associated with deleted projects

On GitLab.com, there are 1560 project notification settings with no valid project all created on 2016-04-15 10:38:53 for some reason. This migration should purge
those entries.
    
b8f38437 should prevent this issue from occurring in the first place.
    
Closes gitlab-com/support-forum#678


See merge request !4311
2016-05-31 16:51:04 +00:00
Stan Hu 4da0778157 Remove project notification settings associated with deleted projects
On GitLab.com, there are 1560 project notification settings with no valid project
all created on 2016-04-15 10:38:53 for some reason. This migration should purge
those entries.

b8f38437 should prevent this issue from occurring in the first place.

Closes gitlab-com/support-forum#678
2016-05-31 08:50:18 -07:00
Kamil Trzcinski 000585be1b Remove update of container_registry_token_expire_delay
This is not needed when we specify a default.
2016-05-31 15:51:45 +02:00
Kamil Trzcinski b1a21a9986 Set container_registry_token_expire_delay default to 5 2016-05-31 15:20:46 +02:00
Kamil Trzcinski f517aa49e1 Fix migration information 2016-05-31 13:49:48 +02:00
Kamil Trzcinski 846d111f1d Add Application Setting to configure Container Registry token expire delay (default 5min) 2016-05-31 13:23:13 +02:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Stan Hu 9485b65abb Add DB index on users.state
Closes #17920
2016-05-29 23:03:08 -07:00
James Lopez e60d5f9188 fix rescue block on migration 2016-05-27 17:20:15 +02:00
Josh Frye 6d2a0a6b9b Remove main_language and tests 2016-05-25 17:16:42 -04:00
ZJ van de Weg 7ae536002a Merge branch 'master' into awardables 2016-05-25 14:41:25 +02:00
Douwe Maan 983b592cb7 Merge branch 'issue_14632' into 'master'
Fix group visibility level migration in case all visibility levels are restricted

fixes #14632 

See merge request !4107
2016-05-20 21:05:18 +00:00