Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display version numbers in builds #1128

Merged
merged 15 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from 12 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* updated tendermint/ui to fix min max override in page send @okwme
* removed unused xmlhttprequest dependency @faboweb
* LCD staking endpoints @fedekunze @faboweb
* the way we show version numbers in the version modal @jbibla

### Added

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ First [Build Gaia](#build-gaia) and [Download the testnet configurations](#downl
Here's an example build command:

```bash
yarn run build --commit=HEAD --network=gaia-7001
yarn run build --commit=HEAD --network=gaia-7005
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change it to 8000 ?

```

You can specify `--help` to see all options with explanations.

Run the app.
Unzip the app version for your OS:
Copy link
Contributor

Choose a reason for hiding this comment

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

unzip? untar? unpack? also should we include the command?

tar -zxvf yourfile.tar.gz


```bash
open builds/Cosmos-{platform}-x64/Cosmos.app
```
- Linux: `builds/Voyager/Cosmos_Voyager-v0.9.4-Linux.tar.gz`
- MacOS: `builds/Voyager/Cosmos_Voyager-v0.9.4-macOS.tar.gz`
Copy link
Collaborator Author

@jbibla jbibla Aug 16, 2018

Choose a reason for hiding this comment

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

but i'm pretty sure this is a .zip @faboweb

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry my mistake

- Windows: `builds/Voyager/Cosmos_Voyager-v0.9.4-Windows.tar.gz`

To test if your build worked run:

```bash
$ yarn test:exe {path to the build executable}
$ yarn test:exe {path to the unpacked executable}
```

To make an official release, follow the instructions in `docs/release.md`.
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const MOCK =
? JSON.parse(process.env.COSMOS_MOCKED)
: false
global.config.mocked = MOCK // persist resolved mock setting also in config used by view thread
const gaiaVersion = fs
.readFileSync(networkPath + "/gaiaversion.txt")
.toString()
.split("-")[0]
process.env.GAIA_VERSION = gaiaVersion

let LCD_BINARY_NAME = "gaiacli" + (WIN ? ".exe" : "")

Expand Down
18 changes: 10 additions & 8 deletions app/src/renderer/components/common/PagePreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ tm-page(title="Preferences")
tm-modal(:close="setAbout", v-if="showAbout")
div(slot="title") About Cosmos Voyager
.about-popup
img( src="~@/assets/images/onboarding/step-0.png")
div Voyager v{{versionVoyager}}
div Cosmos SDK v{{versionSDK}}
img(src="~@/assets/images/onboarding/step-0.png")
div(v-if="voyagerVersion") Voyager {{voyagerVersion}}
div(v-if="gaiaVersion") Cosmos SDK {{gaiaVersion}}

tm-part(title='Settings')
tm-list-item(type="field" title="Select network to connect to")
Expand Down Expand Up @@ -54,6 +54,7 @@ tm-page(title="Preferences")
<script>
import { mapGetters, mapMutations } from "vuex"
import { TmListItem, TmBtn, TmPage, TmPart, TmField } from "@tendermint/ui"
import { remote } from "electron"
import ToolBar from "common/TmToolBar"
import TmModal from "common/TmModal"

Expand All @@ -78,12 +79,15 @@ export default {
]),
showAbout() {
return this.config.showAbout
},
voyagerVersion() {
return remote.app.getVersion()
},
gaiaVersion() {
return process.env.GAIA_VERSION
}
},

data: () => ({
versionVoyager: null,
versionSDK: null,
themeSelectActive: null,
themeSelectOptions: [
{
Expand All @@ -110,8 +114,6 @@ export default {
mounted() {
this.networkSelectActive = this.mockedConnector ? "mock" : "live"
this.themeSelectActive = this.themes.active
this.versionSDK = process.env.GAIA_VERSION.split("-").shift()
this.versionVoyager = process.env.VOYAGER_VERSION
},
methods: {
...mapMutations(["setAbout"]),
Expand Down
1 change: 1 addition & 0 deletions tasks/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = async function(networkPath) {
const gaiaVersion = fs
.readFileSync(networkPath + "gaiaversion.txt")
.toString()
.split("-")[0]
let env = Object.assign(
{},
{
Expand Down
3 changes: 3 additions & 0 deletions test/unit/helpers/electron_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jest.mock("electron", () => ({
"https://4dee9f70a7d94cc0959a265c45902d84@sentry.io/288169"
}
if (name === "root") return "./test/unit/tmp/test_root/"
},
app: {
getVersion: jest.fn(() => "0.5.5")
}
}
}))
2 changes: 1 addition & 1 deletion test/unit/helpers/genesis_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let testRoot = "./test/unit/tmp/test_root/"

function mockGenesis() {
process.env.COSMOS_NETWORK = "./networks/gaiaiaiaiaiaia/"
process.env.GAIA_VERSION = "1.2.3-asdf"
Copy link
Contributor

Choose a reason for hiding this comment

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

do they no longer follow this format?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Jordan preprocesses it on the setter.

process.env.GAIA_VERSION = "1.2.3"
process.env.VOYAGER_VERSION = "3.6.9"
process.env.COSMOS_HOME = testRoot
fs.ensureFileSync(testRoot + "genesis.json")
Expand Down
4 changes: 2 additions & 2 deletions test/unit/specs/components/common/PagePreferences.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ describe("PagePreferences", () => {
wrapper.update()
expect(store.state.config.showAbout).toBe(true)
expect(wrapper.vm.$el.outerHTML).toContain(
"Voyager v" + wrapper.vm.versionVoyager
"Voyager " + wrapper.vm.voyagerVersion
)
expect(wrapper.vm.$el.outerHTML).toContain(
"Cosmos SDK v" + wrapper.vm.versionSDK.split("-").shift()
"Cosmos SDK " + wrapper.vm.gaiaVersion
)
expect(wrapper.vm.$el).toMatchSnapshot()
wrapper.vm.setAbout(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1052,10 +1052,10 @@ exports[`PagePreferences shows versions 2`] = `
src="~@/assets/images/onboarding/step-0.png"
/>
<div>
Voyager v3.6.9
Voyager 0.5.5
</div>
<div>
Cosmos SDK v1.2.3
Cosmos SDK 1.2.3
</div>
</div>
</main>
Expand Down