Giter VIP home page Giter VIP logo

ballerina-update-tool's People

Contributors

anupama-pathirage avatar azinneera avatar hemikak avatar hevayo avatar keizer619 avatar maheshika avatar nipunamadhushan avatar nipunaranasinghe avatar parkavi11 avatar praneesha avatar shafreenanfar avatar suganyasuven avatar udda1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ballerina-update-tool's Issues

Ballerina active distribution is not set properly

Description:
The following commands do not set the ballerina active distribution properly.
sudo bal dist pull slalpha1
sudo bal dist use slalpha1

sudo bal version command returns the following output.

Ballerina Swan Lake Beta 1
Language specification 2021R1
Update Tool 1.3.5

Also, I can't use bal commands without sudo. Running commands without sudo gives permission denied: bal error.

image

Steps to Reproduce
Download Ballerina Swan Lake Beta 1 (linux deb) from https://ballerina.io/downloads/ and install.

Affected Versions:
Ballerina Swan Lake Beta 1

OS, DB, other environment details and versions:
Ubuntu 20.04.2

Improve dependency directory permission checking

Description:
Usually Ballerina installation directory does not have write permissions. This will be checked in pull and update commands and complain users initially.

There are some scenarios like following homebrew installation where it has write permissions for installation directory but does not have write permissions for dependency directory. Update tool complains when trying to extract after downloading dependency. It should check and complain initially before downloading anything for better UX.

% ballerina dist pull slp8

Fetching the 'slp8' distribution from the remote server...
Downloading slp8 100% [=================================================] 242/242 MB (0:00:20 / 0:00:00)

Fetching the dependencies for 'slp8' from the remote server...
Downloading jdk-11.0.8+10-jre 100% [======================================] 41/41 MB (0:00:04 / 0:00:00)
ballerina: permission denied: you do not have write access to '/usr/local/Cellar/ballerina/1.1.3/libexec/dependencies/jdk-11.0.8+10-jre'

ballerina: unable to create the file system cache of Ballerina Central

Reported by Kirill Keker on slack

When you install Ballerina on MacOS, the Root user password is asked during installation to create the /Library/Ballerina folder - this is normal.

Then, when executing the bal update or bal dist update commands, sudo access is also requested because these commands want to get the entry in /Library/Ballerina that belongs to Root.

If after that you did not have the ~/.ballerina folder or you deleted it, then it will be created as root in your folder and you will not have write access. The same will happen if you run sudo bal dist use.In order not to start your rights, if there is only one user on the PC (like mine), then it is better to execute sudo chown -R $USER /Library/Ballerina after installing Ballerina - this command will correct the rights on the user and there will be no more confusion with the rights, no longer have to use sudo and think about which folder belongs to whom.

Help texts are not consistent for all dist commands

Description:
For dist pull,

Fetching the '1.2.1' distribution from the remote server...

For all other commands,

Fetching the latest patch distribution for 'jballerina-1.2.0' from the remote server...
Fetching the 'jballerina-1.2.4' distribution from the remote server...

Suggested Labels:
Type/Improvement

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Ballerina dist list is not showing installed distribution.

Description:
dist list not showing the installed distribution version in the list. However, it is showing the pulled versions.

suganya:~ suganya$ ballerina -v
Ballerina Swan Lake Preview 4
Language specification v2020-09-22
Update Tool 0.8.9-SNAPSHOT
suganya:~ suganya$ 
suganya:~ suganya$ ballerina dist list
Distributions available locally: 


Distributions available remotely:

1.* channel

  [1.0.0] jballerina version 1.0.0
  [1.0.1] jballerina version 1.0.1
  [1.0.2] jballerina version 1.0.2
  [1.0.3] jballerina version 1.0.3
  [1.0.4] jballerina version 1.0.4
  [1.0.5] jballerina version 1.0.5
  [1.1.0] jballerina version 1.1.0
  [1.1.1] jballerina version 1.1.1
  [1.1.2] jballerina version 1.1.2
  [1.1.3] jballerina version 1.1.3
  [1.1.4] jballerina version 1.1.4
  [1.2.0] jballerina version 1.2.0
  [1.2.1] jballerina version 1.2.1
  [1.2.2] jballerina version 1.2.2
  [1.2.3] jballerina version 1.2.3
  [1.2.4] jballerina version 1.2.4
  [1.2.5] jballerina version 1.2.5
  [1.2.6] jballerina version 1.2.6
  [1.2.7] jballerina version 1.2.7
  [1.2.8] jballerina version 1.2.8

Swan Lake channel

  [slp1] Preview 1
  [slp2] Preview 2
  [slp3] Preview 3
  [slp4] Preview 4

Use 'ballerina help dist' for more information on specific commands.
suganya:~ suganya$ ballerina dist pull 1.2.3
ballerina: permission denied: you do not have write access to '/Library/Ballerina'
suganya:~ suganya$ sudo ballerina dist pull 1.2.3
Password:
Fetching the '1.2.3' distribution from the remote server...
Downloading 1.2.3 100% [===================================================================================================================================================================================] 104/104 MB (0:00:31 / 0:00:00) 

Fetching the dependencies for '1.2.3' from the remote server...
Downloading jdk8u202-b08-jre 100% [==========================================================================================================================================================================] 37/37 MB (0:00:11 / 0:00:00) 
'1.2.3' successfully set as the active distribution
suganya:~ suganya$ 
suganya:~ suganya$ ballerina dist list
Distributions available locally: 

* [1.2.3] jballerina version 1.2.3

Distributions available remotely:

1.* channel

  [1.0.0] jballerina version 1.0.0
  [1.0.1] jballerina version 1.0.1
  [1.0.2] jballerina version 1.0.2
  [1.0.3] jballerina version 1.0.3
  [1.0.4] jballerina version 1.0.4
  [1.0.5] jballerina version 1.0.5
  [1.1.0] jballerina version 1.1.0
  [1.1.1] jballerina version 1.1.1
  [1.1.2] jballerina version 1.1.2
  [1.1.3] jballerina version 1.1.3
  [1.1.4] jballerina version 1.1.4
  [1.2.0] jballerina version 1.2.0
  [1.2.1] jballerina version 1.2.1
  [1.2.2] jballerina version 1.2.2
* [1.2.3] jballerina version 1.2.3
  [1.2.4] jballerina version 1.2.4
  [1.2.5] jballerina version 1.2.5
  [1.2.6] jballerina version 1.2.6
  [1.2.7] jballerina version 1.2.7
  [1.2.8] jballerina version 1.2.8

Swan Lake channel

  [slp1] Preview 1
  [slp2] Preview 2
  [slp3] Preview 3
  [slp4] Preview 4

Use 'ballerina help dist' for more information on specific commands.

Suggested Labels:

Suggested Assignees:

Affected Product Version:
0.8.9-SNAPSHOT

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Update current version via installers

Current user experience

  • Currently if existing users downloads an installer and installed new version it still keeps users current version without updating it. User has to manually execute dist use command and set the installed version.
  • We cannot update users current version as installer will be executed as root user and we cannot access users current version which is stored in user home at ~/.ballerina/ballerina-version.

Proposed work around to fix this

  • Currently we keep new installed version in <Installation location>/distributions/ballerina-version. If user deletes user home ballerina-version, tool will switch to installed version.
  • Therefore we can use update tool java code to update user home ballerina-version with new installed ballerina-version with a new check.
  • New check is a new file like installation-version which could a new uuid which stored separately. We cannot use update tool version (0.8.10) to this there could be new releases with same update tool version
  • During the installation both ballerina-version and installation-version file is stored in installed location
  • Currently update tool copies ballerina-version to user home if it doesn't exist. During the same step we can copy installation-version file to user home.
  • In the update tool when it checks ballerina-version we can additionally check installation version in the user home and installed location is same, if not update tool will replace both installation-version and ballerina-version of user of with the files in installed location

Error message is printed twice for version command

Description:
$ title

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

suganya% 
suganya% bal version arg1 arg2
ballerina: too many arguments given
Run 'bal help' for usage.
ballerina: too many arguments
Run 'bal help version' for usage.
suganya% 

Related Issues:

`bal update` and `bal dist pull ....` commands require root access

Description:
$subject.

bal -v // works

bal update // gives permission denied.
sudo bal update // works

bal dist pull slbeta5 // gives permission denied.
sudo bal dist pull slbeta5 // works

Please refer to the below screenshot.
Screenshot from 2021-12-08 10-40-54

OS, DB, other environment details and versions:
update tool version '1.3.6'
Ubuntu 20.04.3 LTS

Pulled version is not set as the active version in ubuntu

Description:
When doing ballerina dist pull, the active version has to changed to the pulled version. However in ubuntu it is not properly set.

Suggested Labels:
Area/BuildTools

Suggested Assignees:

Affected Product Version:
jBallerina 1.2.0
Language specification 2020R1
Ballerina tool 0.8.4

OS, DB, other environment details and versions:
ubuntu

Steps to reproduce:

  • ballerina dist pull jballerina-1.1.1
  • ballerina -v (or ballerina dist list)

Related Issues:

`bal.bat update` fails on win-64 because of somehow misparsing the `install.bat` file.

Description:
bal.bat update results in a string of errors that, clearly, are triggered by something going wrong with windows understanding the command – install.bat from the new download, I believe – to be run to emplace the new version of the update tool.

I'm not sure the problem doesn't originate earlier, though, since the start of the problem is:

C:\Users\danie>bal update
Fetching the latest update tool version from the remote server...
Downloading ballerina-command-1.3.5 100% [============================================================] 1/1 MB (0:00:00 / 0:00:00)
'--------------------------------------------------------------------' is not recognized as an internal or external command,
operable program or batch file.
"2019," was unexpected at this time.
'2' is not recognized as an internal or external command, operable program or batch file.

Given that the bundled update tool with the swan lake beta2 install is 1.3.6, it seems like the attempt to downgrade is probably also a bug.

Full output from my system: bal-update-fail.txt

Steps to reproduce:

  1. Download swan-lake-beta2 from ballerina.io
  2. unpack anywhere; this happened with both the MSI installer in the default location and the zip install in ~/opt/ballerina
  3. restart terminal emulator to get the new PATH in place, or whatever floats your boat there.
  4. run bal update or bal.bat update
    • reproduces for me with powershell 7, and with cmd.exe, so isn't dependent on the initial command processor
  5. watch the system not cope.
  6. realise that it did successfully delete the ballerina-command jar, but didn't put the new one in, so broke the install as well. :)

Affected Versions:
swan-lake-beta2, which has:

PS C:\Users\danie\opt\ballerina> bal version
Ballerina Swan Lake Beta 2
Language specification 2021R1
Update Tool 1.3.6

OS, DB, other environment details and versions:
Windows 10 pro, 64-bit, Version 21H1 (OS Build 19043.1165)

Improve bal dist list output

Description:
We need to do following improvements to current bal dist list command

  • Limit number of remote distributions in 1.x channel to show last 10 releases, if all the distributions need to be listed bal dist list -a should be used. Here we treat 1.0.x, 1.1.x and 1.2.x similar level
  • Local distributions we list the full list as previous even without separating channels
  • Release name has been removed and only version number is kept and mark the -latest release in each channel
  • Swan lake Preview, Beta, Alpha need to be removed upon releasing Swan lake GA

Sample proposed output

$ bal dist list
‘Distributions available locally: 

  1.1.6
  1.2.4
  2201.1.0
* 2201.2.1

Distributions available remotely:

1.* channel

  ... To list all the previous distributions execute `bal dist list -a`
  1.2.11
  1.2.12
  1.2.13
  1.2.14
  1.2.15
  1.2.16
  1.2.17
  1.2.18
  1.2.19
  1.2.20 - latest

Swan Lake channel

  2201.0.0
  2201.1.0
  2201.1.1
  2201.1.2
  2201.1.3
  2201.2.0
* 2201.2.1 -  latest

Improve ballerina dist list output

Description:
We need to improve current ballerina dist list output with;

  • Introduce pagination
  • Channel separation in local distributions.
  • Swan lake local distribution name and remote distribution name is not name. Need to preserve the same name locally.
Distributions available locally:

  [1.1.1] jballerina version 1.1.1
  [1.1.0] jballerina version 1.1.0
* [slp1] ballerina version slp1
  [1.2.1] jballerina version 1.2.1
  [1.0.2] jballerina version 1.0.2
  [1.0.5] jballerina version 1.0.5
  [1.0.4] jballerina version 1.0.4
  [1.0.3] jballerina version 1.0.3
  [1.2.0] jballerina version 1.2.0
  [1.1.2] jballerina version 1.1.2
  [1.1.3] jballerina version 1.1.3
  [1.1.4] jballerina version 1.1.4
  [1.2.2] jballerina version 1.2.2
  [1.0.0] jballerina version 1.0.0
  [1.2.3] jballerina version 1.2.3
  [1.2.4] jballerina version 1.2.4

Distributions available remotely:

1.* channel

  [1.0.0] jballerina version 1.0.0
  [1.0.1] jballerina version 1.0.1
  [1.0.2] jballerina version 1.0.2
  [1.0.3] jballerina version 1.0.3
  [1.0.4] jballerina version 1.0.4
  [1.0.5] jballerina version 1.0.5
  [1.1.0] jballerina version 1.1.0
  [1.1.1] jballerina version 1.1.1
  [1.1.2] jballerina version 1.1.2
  [1.1.3] jballerina version 1.1.3
  [1.1.4] jballerina version 1.1.4
  [1.2.0] jballerina version 1.2.0
  [1.2.1] jballerina version 1.2.1
  [1.2.2] jballerina version 1.2.2
  [1.2.3] jballerina version 1.2.3
  [1.2.4] jballerina version 1.2.4

Swan Lake channel

  [slp1] Preview 1

Use 'ballerina help dist' for more information on specific commands.

ballerina dist remove <-a | --all> removes the current active distribution

Description:
Generally, ballerina dist remove -a should remove all non-active distributions. But this removes active distribution as well.

Suggested Labels:

Suggested Assignees:

Affected Product Version:
Update Tool 0.8.9-SNAPSHOT

OS, DB, other environment details and versions:
Mac, Ubuntu, Windows, CentOS

Steps to reproduce:
Issue ballerina dist remove <-a|--all>
Then issue ballerina dist list.

suganya:~ suganya$ sh /Users/suganya/Desktop/ballerina/ballerina-macos-swan-lake-preview5-SNAPSHOT/bin/./ballerina dist remove -a
All non-active distributions are successfully removed
suganya:~ suganya$ 
suganya:~ suganya$ 
suganya:~ suganya$ 
suganya:~ suganya$ sh /Users/suganya/Desktop/ballerina/ballerina-macos-swan-lake-preview5-SNAPSHOT/bin/./ballerina dist list
Distributions available locally: 


Distributions available remotely:

1.* channel

  [1.0.0] jballerina version 1.0.0
  [1.0.1] jballerina version 1.0.1
  [1.0.2] jballerina version 1.0.2
  [1.0.3] jballerina version 1.0.3
  [1.0.4] jballerina version 1.0.4
  [1.0.5] jballerina version 1.0.5
  [1.1.0] jballerina version 1.1.0
  [1.1.1] jballerina version 1.1.1
  [1.1.2] jballerina version 1.1.2
  [1.1.3] jballerina version 1.1.3
  [1.1.4] jballerina version 1.1.4
  [1.2.0] jballerina version 1.2.0
  [1.2.1] jballerina version 1.2.1
  [1.2.2] jballerina version 1.2.2
  [1.2.3] jballerina version 1.2.3
  [1.2.4] jballerina version 1.2.4
  [1.2.5] jballerina version 1.2.5
  [1.2.6] jballerina version 1.2.6
  [1.2.7] jballerina version 1.2.7
  [1.2.8] jballerina version 1.2.8

Swan Lake channel

  [slp1] Preview 1
  [slp2] Preview 2
  [slp3] Preview 3
* [slp4] Preview 4

Use 'ballerina help dist' for more information on specific commands.
suganya:~ suganya$ 

Related Issues:

Active distribution is not set properly with "ballerina dist pull" in Ubuntu

Description:

  • ballerina dist pull does not set the active distribution properly in Ubuntu. Please refer to the below screenshot.
  • Had to use sudo ballerina run test.bal or set the distribution manually with ballerina dist use slp7 and then run with ballerina run test.bal

Screenshot

OS, DB, other environment details and versions:

Ubuntu 20.04
Kernel: 5.4.0-56-generic

Similar Issues:
#15

Automate the update tool tests in different environments

Description:
Write tests against the update tool zip pack and run it in different environments.

  • Implement tests against the zip pack.
  • Enable MacOS build in Github workflows
  • Enable Windows build in Github workflows

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Migrate Update tool s3 bucket

Description:
We created a separate s3 bucket for Update tool.

Recently we have migrated our all download the artifacts to s3 bucket as well. As pushing to this s3 bucket has been already automated.

We can use this new bucket now onward. Also we can migrate previous releases to new bucket and delete old one. When we do we need to do following

  • Test download speeds
  • Verify hashes as an integrity check

Ballerina dist update do not update to the latest

Description:
When I do a dist update when using jballerina-1.1.4 the ballerina version will be set to jballerina-1.1.1 which is an older version.

Fetching the latest patch distribution for 'jballerina-1.1.4' from the remote server...
Successfully set the latest patch distribution 'jballerina-1.1.1' as the active distribution

Make update tool stand alone

Description:
Update tool should be working executable without a distribution. It should be able to fetch distributions and dependencies and continue.

  • Modify update tool code to support this -> PR #102
  • Pack JREs and create 3 distributions for Linux, MacOS and Windows in addition to the distribution which does not have the JRE -> Done for 0.8.21 version https://github.com/ballerina-platform/ballerina-update-tool/releases/tag/v0.8.21
  • Archive above distributions and modify the ballerina-distributions to fetch from those archives instead of Github Packages -> PR ballerina-platform/ballerina-distribution#1394
  • Include bal dist pull latest support - PR #132
  • Switch homebrew to fetch above archive
  • Modify update tool server api to directly update to latest even without a current distribution. Currently we need to provide existing version and it gives latest of that
  • Improve current repository test coverage using stand alone test cases
  • Implement central admin api to publish update tools programmatically
  • Automate publishing update tool to following
    • Homebrew
    • Update tool Server

Update the Update tool version along with distribution updates

Description:
Currently Update Tool version will be updated manually with bal update command.
Users will unlikely execute above command as we do not enforce it other than specifying in release notes/website download page if required.

In order make it much more frequent, tool will be updated along with bal dist update and bal dist pull <version> commands as well.

As these commands already executed with sudo permissions and users know it will download content from server it will be safe to update tool along with them

Update the BALLERINA_UPDATE_TOOL database

Description:
In the BALLERINA_UPDATE_TOOL DB, the dependency name should be modified and dependency names also need to be added for some ballerina distributions.

Ballerina update command degrades to 0.8.0 when latest version is being used already

Description:
'ballerina update' command degrades to 0.8.0 when the active update tool version is already 0.8.4, instead of pointing that the latest version is already being used.

Suggested Labels:
Area/BuildTools

Suggested Assignees:

Affected Product Version:
jBallerina 1.2.0
Language specification 2020R1
Ballerina tool 0.8.4

OS, DB, other environment details and versions:
CentOS 8

Steps to reproduce:

  • Do ballerina -v to check the current version of the update-tool (tool version has to be the latest, in my case it is 0.8.4)
  • Do ballerina update

Related Issues:

Update homebrew ballerina formula

Description:
We need to restore Homebrew formula with Ballerina GA release. We have halted releasing to that as homebrew did not allow to publish pre releases (alpha, beta)

`bal dist pull <invalid distribution>` shows that it is fetching from the remote server

Description:
For sudo bal dist pull slbeta8

The output is :

Checking whether any latest update tool version is available...
Fetching the 'slbeta8' distribution from the remote server...
ballerina: distribution 'slbeta8' not found

Describe your solution(s)
Check the validity of the distribution and avoid showing the 'fetching' line in the output text.

dist pull hangs when the network is unavailable for more than 5 mins

Description:
While downloading a specific jballerina distribution, I disconnect the internet connection and waited for 5 mins then connected back to internet. Downloading didnt time out or continued after reconnection.
It should time out after some time.

➜  bin ./ballerina dist pull jballerina-1.0.1
Downloading jballerina-1.0.1   8% [===========> ]  8/99 (0:06:15 / 1:11:16)


Downloading jballerina-1.0.1   8% [===========> ]  8/99 (0:06:16 / 1:11:27)
Downloading jballerina-1.0.1   8% [===========> ]  8/99 (0:12:26 / 2:21:35)

Affected version : 0.8.0
OS : Mac

Include a test mode for update tool client

Description:
Currently from the update tool has been used for automated test cases and from the back end server there is no way to identify those events and actual user events.

Therefore test mode flag needs to be included in the update tool client side and include that as a header when invoking update tool server. This flag should be able to enable via env variables, then we can enable it in automated test scenarios.

Helper messages still have 'ballerina <command>' in texts

Description:

Tested with Ubuntu

$ bal version
Ballerina Swan Lake Alpha
Language specification v2020-12-17
Update Tool 0.8.11
$ bal use slp8
ballerina: unknown command 'use'
Run 'ballerina help' for usage.
$ bal dist use slp8
Distribution 'slp8' not found
Run 'ballerina dist pull slp8' to fetch and set the distribution as the active distribute

Should be bal

Improve `ballerina dist update` command output

Here is the current output

Fetching the latest patch distribution for 'jballerina-1.0.4' from the remote server...
Fetching the 'jballerina-1.0.5' distribution from the remote server...
Downloading jballerina-1.0.5 100% [========================] 96/96 MB (0:00:27 / 0:00:00) 
Successfully set the latest patch distribution 'jballerina-1.0.5' as the active distribution

I think the first two lines sound a bit boring. Can merge them into a single message?

`ballerina -v` gives incorrect version if we execute without sudo

Description:
For the latest Ubuntu version, ballerina -v gives the incorrect version if it is executed without sudo.

Steps to reproduce:
In Ubuntu-16.04, ballerina -v shows the correct version without sudo.

suganya@suganya-VirtualBox:~$ sudo ballerina dist pull slp5
[sudo] password for suganya:
Fetching the 'slp5' distribution from the remote server...
Downloading slp5 100% [======================] 297/297 MB (0:01:58 / 0:00:00)

Fetching the dependencies for 'slp5' from the remote server...
Dependency 'jdk-11.0.8+10-jre' is already available locally
'slp5' successfully set as the active distribution
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$ ballerina -v
Ballerina Swan Lake Preview 5
Language specification v2020-09-22
Update Tool 0.8.10
suganya@suganya-VirtualBox:~$

However, in Ubuntu-20.10, we have to use sudo to get the correct version.

suganya@suganya-VirtualBox:~$ sudo ballerina dist pull jballerina-1.2.3
Fetching the 'jballerina-1.2.3' distribution from the remote server...
Downloading jballerina-1.2.3 100% [==========] 104/104 MB (0:00:43 / 0:00:00)
'jballerina-1.2.3' successfully set as the active distribution
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$ ballerina -v
jBallerina 1.1.0
Language specification 2019R3
Ballerina tool 0.8.0
suganya@suganya-VirtualBox:~$ sudo ballerina -v
jBallerina 1.2.3
Language specification 2020R1
Ballerina tool 0.8.0

Similar issue:
#50
#15

Uninstalling ballerina does not work properly

Description:
Tested with ubuntu 18.

Here is the output

waruna@warunaj:~$ sudo apt-get remove ballerina-swan-lake-alpha1 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni libgif7 ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  ballerina-swan-lake-alpha1
0 upgraded, 0 newly installed, 1 to remove and 156 not upgraded.
After this operation, 339 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 207075 files and directories currently installed.)
Removing ballerina-swan-lake-alpha1 (2-swan-lake-alpha1) ...
rm: cannot remove '/usr/bin/ballerina': No such file or directory

Issues

  1. Still shows rm: cannot remove '/usr/bin/ballerina': No such file or directory and /usr/bin/bal file still there
  2. /usr/lib/ballerina/ directory still contain the old files.

Ballerina dist list does not work for offline first time users

Description:

Channel information is fetched from update server and kept in the ~/.ballerina/local-dists.json file locally.
This file will be created with ballerina dist list command.

If there are offline users who executes dist list command for first time will get following output as above json file is empty and cannot be loaded from server. Ideally users should be able to switch local distributions even they are offline.

➜  .ballerina ballerina dist list
Distributions available locally: 



ballerina: connection to the remote server failed

slalpha3 - Not honoring different distrubution

Description:
Using Ballerina Swan Lake Alpha 3, I am unable to use a different distribution bal dist use 1.2.6.

Example of a 1.2.6 based project that has been in production for while when trying to run with Alpha 3:

ERROR [main.bal:(2:1,2:25)] cannot resolve module 'ballerina/config'
ERROR [main.bal:(4:1,4:29)] cannot resolve module 'ballerina/kubernetes'
ERROR [main.bal:(6:1,6:30)] cannot resolve module 'ballerina/stringutils'
ERROR [main.bal:(38:28,40:3)] incompatible types: expected 'ballerina/http:1.1.0-alpha5:Client', found '(ballerina/http:1.1.0-alpha5:Client|ballerina/http:1.1.0-alpha5:ClientError)'
ERROR [main.bal:(39:5,39:20)] undefined field 'timeoutInMillis' in record 'ballerina/http:1.1.0-alpha5:ClientConfiguration'
ERROR [main.bal:(39:22,39:51)] undefined function 'getAsInt'
ERROR [main.bal:(39:22,39:51)] undefined module 'config'
ERROR [main.bal:(54:24,54:58)] incompatible types: expected 'ballerina/http:1.1.0-alpha5:Client', found '(ballerina/http:1.1.0-alpha5:Client|ballerina/http:1.1.0-alpha5:ClientError)'
ERROR [main.bal:(54:28,54:57)] undefined function 'getAsString'
ERROR [main.bal:(54:28,54:57)] undefined module 'config'
ERROR [main.bal:(56:1,58:2)] undefined annotation 'Service'
ERROR [main.bal:(56:1,58:2)] undefined module 'kubernetes'
ERROR [main.bal:(62:1,72:2)] undefined annotation 'Deployment'
ERROR [main.bal:(62:1,72:2)] undefined module 'kubernetes'
ERROR [main.bal:(73:1,75:2)] undefined annotation 'ConfigMap'
ERROR [main.bal:(73:1,75:2)] undefined module 'kubernetes'
ERROR [main.bal:(77:5,77:13)] undefined field 'basePath' in record 'ballerina/http:1.1.0-alpha5:HttpServiceConfig'
ERROR [main.bal:(80:9,80:15)] unknown type 'person'
ERROR [main.bal:(82:9,82:16)] undefined field 'methods' in record 'ballerina/http:1.1.0-alpha5:HttpResourceConfig'
ERROR [main.bal:(83:9,83:13)] undefined field 'path' in record 'ballerina/http:1.1.0-alpha5:HttpResourceConfig'

Suggested Labels:

Suggested Assignees:

Affected Product Version:

Ballerina Swan Lake Alpha 3
Language specification v2020-12-17
Update Tool 1.3.1

OS, DB, other environment details and versions:

Steps to reproduce:

  1. Install deb
  2. bal dist pull 1.2.6
  3. bal dist use 1.2.6
  4. Run existing 1.2.6 based project

Related Issues:

Revisit ballerina tool CLI name text

Description:
Ballerina tool provides the following output, when executing ballerina/bal command, in swan lake alpha pack.

Screenshot from 2021-01-25 13-00-48

IMO it would be better if we can come up with a better name such as The ballerina update tool, The ballerina tool, etc.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

ballerina update will show 'ballerina dist update' in output message

Description:

When ballerina update executes it successfully update it but it shows If you want to update the Ballerina distribution, use 'ballerina dist update' as following output.

Seems like this message comes from from previous ballerina command java code. We might attempt to exit as install script ended

ballerina update   
Fetching the latest tool version from the remote server...
Downloading ballerina-command-0.8.11 100% [===================================================================================================] 1/1 MB (0:00:01 / 0:00:00) 
cp: /Library/Ballerina/bin/../ballerina-command-tmp/../lib/ballerina-command-0.8.11.jar: Permission denied
error occurred while copying ballerina jar
Update successfully completed

If you want to update the Ballerina distribution, use 'ballerina dist update'

ballerina dist pull command is not working for CentOS

Description:
When a new ballerina distribution is pulled it is not set as the active version in CentOS. However, it the same distribution is not allowed to remove as it is set as the actve distribution.

Please refer the following screenshot.
Screen Shot 2020-03-16 at 09 38 04

Suggested Labels:
Area/BuildTools, Priority/Blocker, Type/Bug

Suggested Assignees:

Affected Product Version:
jBallerina 1.2.0-RC1
Language specification 2020R1
Ballerina tool 0.8.2

OS, DB, other environment details and versions:
CentOS 8

Steps to reproduce:

  • ballerina dist pull jballerina-1.1.4
  • ballerina dist list

Related Issues:

Test Automation

Description:

  • Implement integration tests in distribution repository for update tool (ballerina-platform/ballerina-distribution#1275)
  • Separate installers tests and update tool tests in current installer tests (ballerina-platform/ballerina-release#84)
  • Installers tests should be executed when installers been generated
  • Update tool tests should be executed when new update tool version is released
  • Update ballerina to bal command change in current installer tests
  • Enable Macos tests in current installers as Github Actions support Macos
  • Enable Windows tests by resolving windows
    • Make sure tests are running in local windows machine
    • Check whether possible to fix Github Action permission issue

[Unix(Ubuntu/MacOS)] bal dist pull command gives unexpected error text when the current update tool version is not the latest

Label: High Priority

Description:
When we run the bal dist pull <distribution> command in Ubuntu or MacOS, it gives unexpected error text as follows. But the bal command runs without any issue after that. (Tested Version of Update Tool - 1.3.7-rc1, Latest version - 1.3.6)

Checking for newer versions of the update tool...
Downloading ballerina-command-1.3.6 100% [==========] 1/1 MB (0:00:00 / 0:00:0
Updating environment variables
The ‘ballerina’ command was changed to ‘bal’. Please use ‘bal’ command from now onwards.
Ie : $ bal build
     $ bal dist list
     $ bal dist update
Update tool version updated to the latest version: 1.3.6
Cleaning old files...

Update successfully completed

Fetching the 'slbeta5' distribution from the remote server...
Downloading slbeta5 100% [===================] 179/179 MB (0:01:10 / 0:00:00) 

Fetching the dependencies for 'slbeta5' from the remote server...
Dependency 'jdk-11.0.8+10-jre' is already available locally
'slbeta5' successfully set as the active distribution
/Library/Ballerina/bin/bal: line 131: unexpected EOF while looking for matching `"'
/Library/Ballerina/bin/bal: line 136: syntax error: unexpected end of file

Steps to reproduce:
Run the following command as a given distribution version exists or not exists.
bal dist pull <distribution>

Affected Versions:
Update Tool Version - 1.3.7-rc1

Ballerina version is not picked after the dist update

Description:
$title

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:
windows

Steps to reproduce:
Issue ballerina dist update followed by ballerina -v

suganya:~ suganya$ sudo ballerina dist update
Fetching the latest patch distribution for 'jballerina-1.2.0' from the remote server...
Fetching the 'jballerina-1.2.4' distribution from the remote server...
Downloading jballerina-1.2.4 100% [========================================================================================================================================================================] 110/110 MB (0:00:46 / 0:00:00) 

Fetching the dependencies for 'jballerina-1.2.4' from the remote server...
Dependency 'jdk8u202-b08-jre' is already available locally
Successfully set the latest patch distribution 'jballerina-1.2.4' as the active distribution

suganya:~ suganya$ ballerina -v
Ballerina Swan Lake Preview 1
Language specification v2020-06-18
Update Tool 0.8.7

Related Issues:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.