Skip to content

Commit

Permalink
Merge pull request #8611 from Dilhasha/ddeprecate-package
Browse files Browse the repository at this point in the history
Add documentation for deprecating all versions of a package
  • Loading branch information
praneesha authored Feb 12, 2024
2 parents 06854c1 + 7c1122f commit fd96f55
Showing 1 changed file with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,38 @@ After publishing your first package, you can create a second package and use the

>**Info:** For more information, see [Import a module](/learn/manage-dependencies/#import-a-module).
### Deprecate a published version of a package
## Deprecate packages published in Ballerina Central

If you have released a package version containing a critical bug or security vulnerability, it is possible to deprecate that specific version.
You can deprecate a specific version or all versions of a published package due to name changes, bugs, or security vulnerabilities.

To deprecate a particular version of a package on Ballerina Central, the package owner can run the following command.
### Deprecate all versions of a published package

An optional deprecation message can also be included, which will be displayed to current users of the package.
For example, if you want to change the name of a published package, execute the command below to mark all the versions of the existing package as deprecated and then, publish the package under a new name.

>**Info:** An optional deprecation message can also be included, which will be displayed to current users of the package.
```
$ bal deprecate <org-name>/<package-name>:<version> --message <deprecation-message>
$ bal deprecate <org-name>/<package-name> --message <deprecation-message>
```

A deprecated package version will not appear in package searches on Ballerina Central or the CLI. Additionally, it will not be used for dependency resolution unless it is already a part of a sticky build or no other compatible package version exists.
### Deprecate a specific version of a published package

For example, if you have released a package version containing a critical bug or security vulnerability, it is possible to deprecate that specific version.

If the deprecated version is in use, a warning message containing the provided deprecation message will be shown during the project build.
To deprecate a particular version of a package on Ballerina Central, the package owner can run the same command with the package version.

```
$ bal deprecate <org-name>/<package-name>:<version> --message <deprecation-message>
```

>**Info:** If the deprecated package or version is in use, a warning message containing the provided deprecation message will be shown during the project build.
A deprecated package or version will not appear in package searches on Ballerina Central or the CLI. Additionally, it will not be used for dependency
resolution unless it is already a part of a sticky build or no other compatible package version exists.

### Undo deprecation of a package

To reverse the deprecation of a package, execute the same command with the `--undo` flag.
Execute the command with the `--undo` flag below to reverse the deprecation of a package.

```
$ bal deprecate <org-name>/<package-name>:<version> --undo
$ bal deprecate <org-name>/<package-name>[:<version>] --undo
```

0 comments on commit fd96f55

Please sign in to comment.