When the webpack.config.js was updated in !11815 (merged) it removed the default sourcemap configuration from the webpack compile process. When run with dev-server, or karma, or when compiled for production there would be a sourcemap config, but not when compiled for testing with yarn webpack.
We need to restore this so that we can more accurately debug our frontend code when rspec fails in CI.
Update:
It seems that although it is true we don't generate sourcemaps for rspec tests in CI, it doesn't matter much because adding them back doesn't produce anything more useful. This appears to be a limitation of PhantomJS or of Capybara/Poltergeist. Strangely our stack traces worked fine with PhantomJS when run through Karma. Currently marking as blocked until #30876 (moved) is resolved.
I've spent a good deal of time fiddling with the config.devtool setting in webpack and I cannot seem to find a single setting that produces useful stack traces in our rspec feature tests:
Here's using #cheap-module-eval-source-map:
Capybara::Poltergeist::JavascriptError: One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details). ReferenceError: Can't find variable: doesNotExist ReferenceError: Can't find variable: doesNotExist at undefined:67 in getEmojiCategoryMap at :160 in createEmojiMenu at :55 at :0 in sendEvent at phantomjs://code/web_page.js:55 at phantomjs://code/web_page.js:501 in mouseEvent at phantomjs://code/node.js:67 in mouseEvent...
Here's the output using no sourcemap at all:
Capybara::Poltergeist::JavascriptError: One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details). ReferenceError: Can't find variable: doesNotExist ReferenceError: Can't find variable: doesNotExist at http://127.0.0.1:42979/assets/webpack/main.bundle.js:30694 in getEmojiCategoryMap at http://127.0.0.1:42979/assets/webpack/main.bundle.js:25006 in createEmojiMenu at http://127.0.0.1:42979/assets/webpack/main.bundle.js:24901 at :0 in sendEvent at phantomjs://code/web_page.js:55 at phantomjs://code/web_page.js:501 in mouseEvent at phantomjs://code/node.js:67 in mouseEvent...
It is true that we aren't currently generating source maps for our rspec tests in CI, but whether we fix this or not seems to have no real impact. In fact, doing nothing and leaving the crazy main.bundle.js:30694 style line numbers may be better in the short term, since at the very least we can find download the compiled asset artifacts and find that line number to reverse-engineer the actual source.
GitLab is moving all development for both GitLab Community Edition
and Enterprise Edition into a single codebase. The current
gitlab-ce repository will become a read-only mirror, without any
proprietary code. All development is moved to the current
gitlab-ee repository, which we will rename to just gitlab in the
coming weeks. As part of this migration, issues will be moved to the
current gitlab-ee project.
If you have any questions about all of this, please ask them in our
dedicated FAQ issue.
Using "gitlab" and "gitlab-ce" would be confusing, so we decided to
rename gitlab-ce to gitlab-foss to make the purpose of this FOSS
repository more clear
I created a merge requests for CE, and this got closed. What do I
need to do?
Everything in the ee/ directory is proprietary. Everything else is
free and open source software. If your merge request does not change
anything in the ee/ directory, the process of contributing changes
is the same as when using the gitlab-ce repository.
Will you accept merge requests on the gitlab-ce/gitlab-foss project
after it has been renamed?
No. Merge requests submitted to this project will be closed automatically.
Will I still be able to view old issues and merge requests in
gitlab-ce/gitlab-foss?
Yes.
How will this affect users of GitLab CE using Omnibus?
No changes will be necessary, as the packages built remain the same.
How will this affect users of GitLab CE that build from source?
Once the project has been renamed, you will need to change your Git
remotes to use this new URL. GitLab will take care of redirecting Git
operations so there is no hard deadline, but we recommend doing this
as soon as the projects have been renamed.
Where can I see a timeline of the remaining steps?