Commit graph

251 commits

Author SHA1 Message Date
Rémy Coutable 6dc0b0331e Revert "Merge branch 'ashmckenzie/new-shellcheck-job' into 'master'"
This reverts merge request !73512
2021-11-09 11:38:50 +00:00
Ash McKenzie 10bb7811a9
Shellcheck offence fixes 2021-11-09 17:23:31 +11:00
Matthias Käppler f52c7ef5be Extract sidekiq-cluster to top-level directory
This prevents name clashes with library code that
is auto-loaded in workers from lib/
2021-11-08 15:27:49 +00:00
Ash McKenzie cd675d9ca6
Trap kill signal and call cleanup/stop 2021-11-01 15:51:46 +11:00
yhgupta eb8e562cb8 Fixed remaining cop offenses for Naming/FileName 2021-10-26 15:57:14 +00:00
Peter Leitzen 46347f14f4 Merge branch 'improve-background-jobs-script' into 'master'
Improve bin/background_jobs script

See merge request gitlab-org/gitlab!72016
2021-10-11 10:47:05 +00:00
Chad Woolley 30d7535b17 Revert "Add spring support to rails/rake binstubs"
This reverts commit 28f82411be.
2021-10-09 12:43:46 -07:00
Sean McGivern 85cb6e69aa
Write output of bin/background_jobs to stdout and log file
bin/background_jobs would write to stdout with `start_foreground`, and
to log/sidekiq.log with `start` or `restart`. That was confusing, as
other application log files are in log/ in development. To simplify
this, use `tee` to make `start_foreground` both write to stdout and
log/sidekiq.log.
2021-10-08 14:46:30 +00:00
Sean McGivern 0c75f2121a
Allow specifying queues for bin/background_jobs
If you set the SIDEKIQ_QUEUES environment variable, bin/background_jobs
will use that queue list rather than the default ('*'; all queues).
2021-10-08 14:45:46 +00:00
Chad Woolley 28f82411be Add spring support to rails/rake binstubs
- It seems to have been inadvertently removed as part of Rails 5
  upgrade: https://gitlab.com/gitlab-org/gitlab/-/commit/44fef4fe
2021-10-07 18:01:46 -07:00
Markus Koller ee294453d8
Convert pngquant tasks into shell script, support file arguments 2021-09-15 19:21:05 +02:00
Rémy Coutable c6e9a0f89c Merge branch 'fix-bundler-setup' into 'master'
Reset bundler settings after locating Gemfile

See merge request gitlab-org/gitlab!69770
2021-09-08 08:53:12 +00:00
Lin Jen-Shin 545f3a4fe5 Reset bundler settings after locating Gemfile 2021-09-08 01:41:04 +08:00
Heinrich Lee Yu f85d295baa
Make bin/background_jobs use Sidekiq cluster
Sets the default number of workers to 1 if SIDEKIQ_WORKERS is not
provided.

This also fixes a bug where we are starting 1 more process than
requested.
2021-09-07 15:51:47 +08:00
Lin Jen-Shin c485b9f1bc Make sure we respect bundler config for Gemfile 2021-09-02 22:02:28 +08:00
Alex Kalderimis 0f563756b2 Skip hooks when pushing security branches with secpick
This makes sense, because some hooks will fail if the security master
and origin master are very different, but we know (from the generated
command) that the use of push here is safe.
2021-08-03 13:07:02 +00:00
Heinrich Lee Yu b6522f806e
Remove unused ActionCable standalone files
We decided not to support running ActionCable on a separate Puma process
so we no longer need these files
2021-07-08 21:00:58 +08:00
Ash McKenzie 08a6d18bef Ensure any args are passed onto sidekiq 2021-07-05 11:32:12 +00:00
Aleksei Lipniagov 74b58f507f
Remove start-up scripts for Unicorn web server
Split from https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61888.

Changelog: removed
2021-05-21 16:34:38 -07:00
Yorick Peterse 8a9cab534d
Update tooling/docs for the new changelog workflow
This updates the changelog documentation to cover the new changelog
workflow, and Danger to check for this new workflow correctly.
2021-05-21 15:40:23 +02:00
Aleksei Lipniagov 7db73f4c5c Remove unused bin/pkgr_before_precompile.sh
Delete no longer used script.
Split from https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61888.
2021-05-19 12:49:52 +03:00
Quang-Minh Nguyen 1beb0c24a9 Extract Sidekiq query selector matching logic to a new class 2021-04-19 10:27:11 +00:00
Amy Qualls ee4f53b7d9 Update capitalization of "merge request"
Fixing lots of random instances of "merge request" where it was
miscapitalized. The "M" should only be capitalized at the beginning
of a sentence or slug, and the "R" should never be capitalized.
2021-04-12 13:35:41 -07:00
Joerg Behrmann c440a8ddd4 Send SIGINT instead of SIGQUIT to puma
Puma does not handle SIGQUIT [1], so worker processes will not get
terminated when calling /etc/init.d/gitlab stop

[1] https://github.com/puma/puma/blob/master/docs/signals.md
2021-02-19 14:20:24 -08:00
Markus Koller ade74215fb Fix Style/FrozenStringLiteralComment violations in scripts
Auto-corrected with Rubocop
2021-02-12 09:09:19 +00:00
Matthias Fechner 86c45706a2 Use the shells background feature to put it into background.
Puma version 5 had removed the `-d` option.
This should fix #299570.
2021-01-23 10:00:54 +01:00
Kamil Trzciński 165fe03af3 Upgrade spring to 2.1.1
The `bundler 2.1.4` and `ruby 2.7`
do require a new spring version
due to how gems are being resolved.
2020-11-08 16:13:09 +01:00
Alex Kalderimis d25fd5842d Add specs for simple lazy promise
This promise abstracts over a few different kinds of laziness we have,
without coupling super tightly to the GitlabSchema.
2020-10-30 12:22:42 +00:00
Rémy Coutable e32809d642 Merge branch 'feature-flag-milestone' into 'master'
Extend `bin/feature-flag` with `milestone`

See merge request gitlab-org/gitlab!46463
2020-10-29 19:55:33 +00:00
Vitali Tatarintev d6ba2a8b53 Merge branch 'ImproveShellScriptsChangeDirException' into 'master'
Execute `exit 1` when shell script `cd` fails

See merge request gitlab-org/gitlab!46122
2020-10-29 15:57:50 +00:00
Kamil Trzciński 002cbbcb2a Extend bin/feature-flag with milestone
This reads a milestone from `VERSION`
and appends `milestone:` to YAML
2020-10-29 16:09:30 +01:00
Vitali Tatarintev 8af3babfc8 Merge branch 'ImproveShellScriptsVariable' into 'master'
Declare and assign variable separately in Shell Script

See merge request gitlab-org/gitlab!46121
2020-10-29 12:49:51 +00:00
Kamil Trzciński c56cb31258 Disallow of feature flags to use licensed names
This ensures that all feature flags are explicitly
used, and have a unique meaning.

This work does:
- hide `licensed` from `bin/feature-flag`
- discovers the feature flag names to collide with licensed feature
  names
- disallows to use licensed names in feature flag API
  (unless `force=1`)
- removes mentions about implicit feature flags

This does not:
- remove implicit feature flag check
- the removal of implicit feature flag will be done at some point later
2020-10-28 10:03:44 +00:00
Peter Dave Hello 95c8007eba Execute exit 1 when shell script cd fails
It's dangerous when `cd` fails but following commands keeps running
which would lead to expected results.

For those shell scripts without `set -e`, use `exit 1` before furthur
refactor could be a safe and efficient workaround, for thoes shell
scripts with `-e`, the shell(script) will exit immediately if any
command has a non-zero exit status, so they don't need `exit 1`

Reference:
- https://github.com/koalaman/shellcheck/wiki/SC2164
2020-10-26 18:51:31 +08:00
Peter Dave Hello 13976cda29 Declare and assign variable separately in Shell Script
To avoid masking return values, declare and assign separately.

Reference:
- https://github.com/koalaman/shellcheck/wiki/SC2155
2020-10-26 18:42:53 +08:00
Kamil Trzciński 77e858aea7 Improve bin/feature-flag script
This makes:

- `licensed` flags to be `ee-only`
- ensure that resulting YAML is always ordered
2020-09-22 15:11:44 +02:00
Marcel Amirault 243fb8ee6b Update feature flag details 2020-09-16 17:16:41 +00:00
Kamil Trzciński 1a1dd33219 Add support for feature flag type Licensed
Our implicit licensed features are YAML stored.
2020-09-09 15:46:56 +02:00
Kamil Trzciński 7a908a0fab Add template and MR question to feature-flag
This does:
- extend `issue_url` with `template`
- asks for `introduced_by_url`
2020-08-17 12:06:10 +02:00
Kamil Trzciński ef9a63b63f Simplify bin/feature-flag script
Do not ask for type if it is only one.
2020-07-23 18:19:47 +02:00
Thong Kuah 36890b3fad Enable raw stackprof collection for flamegraphs
Also add documentation on how to generate flamegraphs.
2020-07-15 10:12:36 +00:00
Kamil Trzciński 769d06200b Fix conflicting Options
The `bin/` scripts do define `Options`.
Move the `Options` into `*Parser` class
to avoid conflicting definitions
2020-07-06 14:05:40 +02:00
Rémy Coutable e69768c09f Merge branch 'add-bin-feature-flag' into 'introduce-feature-flag-definition'
Add bin feature flag (RUN AS-IF-FOSS)

See merge request gitlab-org/gitlab!35540

(cherry picked from commit 82b09ab593)

388079df Add `bin/feature-flag` script
1432ee17 Apply 1 suggestion(s) to 1 file(s)
2020-07-06 11:40:08 +00:00
Kamil Trzciński 21e346e048 Revert "Merge branch 'add-bin-feature-flag' into 'introduce-feature-flag-definition'"
This reverts merge request !35540
2020-07-02 20:24:49 +00:00
Kamil Trzciński b21993ff8f Add bin/feature-flag script
This helps with creating a new
feature flag in repository
by asking a bunch of questions
to put into the YAML definition
2020-07-01 14:23:43 +00:00
Daniel Paul Searles b327a93e5f
Fix the default sha for bin/secpick
Why:

* The shell command to read the current sha has an ending newline that
  should be stripped.

This change addresses the need by:

* strip whitespace from sha when reading the current sha
* refactor original_branch to strip whitespace at the point it could be
  introduced
2020-06-02 15:31:53 -07:00
Daniel Paul Searles e1ee11ebf6
Remove ee? check from secpick script
Why:

* We no longer distinguish between ee and foss at the repo level

This change addresses the need by:

* Remove ee? method and usage
2020-06-01 14:14:29 -07:00
Lin Jen-Shin 9f46e2b10d Merge branch 'ImproveMethodToLocateCommand' into 'master'
Use shell builtin `command -v` instead non-standard `which`

See merge request gitlab-org/gitlab!32773
2020-05-27 15:19:58 +00:00
Rémy Coutable 14822a68c0 Merge branch 'FixShellScriptIndent' into 'master'
Unify indentation in shell scripts

See merge request gitlab-org/gitlab!32767
2020-05-25 12:15:49 +00:00
Peter Dave Hello 601ebdc49a Use shell builtin command -v instead non-standard which
Reference:
- https://github.com/koalaman/shellcheck/wiki/SC2230
2020-05-23 00:55:51 +08:00