Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ui/public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"basicZoneEnabled": true,
"multipleServer": false,
"allowSettingTheme": true,
"docHelpMappings": {}
"docHelpMappings": {},
"notifyLatestCSVersion": true
}
4 changes: 3 additions & 1 deletion ui/src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ const user = {
const result = response.listusersresponse.user[0]
commit('SET_INFO', result)
commit('SET_NAME', result.firstname + ' ' + result.lastname)
store.dispatch('SetCsLatestVersion', result.rolename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue where it is making 2 API calls.

resolve(cachedApis)
}).catch(error => {
reject(error)
Expand Down Expand Up @@ -556,6 +555,9 @@ const user = {
commit('SET_DOMAIN_STORE', domainStore)
},
SetCsLatestVersion ({ commit }, rolename) {
if (!vueProps.$config.notifyLatestCSVersion) {
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of Github, we should query one of the ASF or repo links to find latest release? For example - https://dlcdn.apache.org/cloudstack/releases/ - we may even introduce to put like a file that gives latest version info say from https://download.cloudstack.org/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohityadavcloud , I am not sure this would be easily cleanly implemented.

https://api.github.com/repos/apache/cloudstack/releases give a cleanish yaml with results.

In contrast https://dlcdn.apache.org/cloudstack/releases/ gives a directory listing.
https://download.cloudstack.org/ also gives a directory listing which is really messy.

I would prefer to continue as is but make the retrieval of new version optional, advising operators to set it on test environments and to disable it in production.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just put a file on cloudstack.apache.org, for example

https://cloudstack.apache.org/latest_cloudstack_version ?

We do not need to get the new version very soon after the release, 1-7 days delay is good I think.

const lastFetchTs = store.getters.latestVersion?.fetchedTs ? store.getters.latestVersion.fetchedTs : 0
if (rolename === 'Root Admin' && (+new Date() - lastFetchTs) > 24 * 60 * 60 * 1000) {
axios.get(
Expand Down
Loading