Skip to content

Resolve "Add messages to warn and stop users when attempting to change the path of projects with NPM packages"

What does this MR do?

Display a message and stop the users when the path of projects with NPM packages is updated. More precisely, it's when users try to update the root namespace of projects with NPM packages that the action is blocked and a message is displayed.

According to the docs, an NPM package must be published under a scope and this scope must have the same name as the root namespace. If this root namespace changes then npm publish will no longer work.

Given a project Project with NPM packages, here are the 3 actions where this check is executed:

  • Update path of a group which is also a root namespace for Project.
  • Transfer a subgroup containing Project out of its root namespace.
  • Transfer Project out of its root namespace.

The check looks for projects within the given group or subgroup.

If the check fails, the action is aborted and a message is displayed

see #12417 (closed)

Screenshots

Here are the 3 different actions:

Update path of a group: Screenshot_2019-10-16_at_08.55.18

Transfer a subgroup out of its root namespace: Screenshot_2019-10-16_at_08.56.47

Transfer a project out of its root namespace: Screenshot_2019-10-16_at_08.58.58

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by David Fernandez

Merge request reports