Commit 79189fbd authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'gotcha-read-app-assets' into 'master'

Document gotcha reading from assets dir

See merge request gitlab-org/gitlab!44104
parents cd8c0c73 2c97f2ff
......@@ -3,6 +3,21 @@
The purpose of this guide is to document potential "gotchas" that contributors
might encounter or should avoid during development of GitLab CE and EE.
## Do not read files from app/assets directory
Since GitLab 10.8, Omnibus has [dropped the `app/assets` directory](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/2456),
after asset compilation. The `ee/app/assets`, `vendor/assets` directories are dropped as well.
This means that reading files from that directory will fail in Omnibus-installed GitLab instances:
```ruby
file = Rails.root.join('app/assets/images/logo.svg')
# This file does not exist, read will fail with:
# Errno::ENOENT: No such file or directory @ rb_sysopen
File.read(file)
```
## Do not assert against the absolute value of a sequence-generated attribute
Consider the following factory:
......
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