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

Ability to find version and git hash from which Taquito was built #638

Closed
jevonearth opened this issue Feb 19, 2021 · 2 comments · Fixed by #781
Closed

Ability to find version and git hash from which Taquito was built #638

jevonearth opened this issue Feb 19, 2021 · 2 comments · Fixed by #781
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jevonearth
Copy link
Collaborator

jevonearth commented Feb 19, 2021

As a developer, I want to get Taquito version, so that I can display it in Dapps or add conditional logic to my Dapp.

Acceptance criteria:

  • Expose version tag and git sha from the TezosToolkit instance

Note, when this is implemented, all Taquito demo dapps will display the version of Taquito that is in use for testing purposes.

  • To implement, the build process will have to update constants in the Taquito source code.
  • The getVersionInfo method should be implemented in all the Taquito packages.
@Innkst Innkst added the enhancement New feature or request label Mar 3, 2021
@Innkst Innkst added this to the v8.1 milestone Mar 3, 2021
@ac10n
Copy link
Contributor

ac10n commented Mar 8, 2021

I have a few questions to make sure my understanding of this issue is right:

  1. In CI, some new constants in src/constants.ts should be updated to reflect git sha (short and/or long?)
  2. These constants be exposed in a new method in src/taquito.ts
  3. The changes made in CI to the src/constants.ts will not be pushed back to the repository (so we understand the real source code that produces the package is not available, one side effect of this is that if we do a manual publish outside of CI/CD, these values are not right, unless explicitly updated manually)
  4. The version is better to be read directly from package.json, because it is updated by lerna right before publishing. Otherwise we need to use lerna version and after that copy the new version into the relevant constant. Which one, if any, is the right one?

@jevonearth
Copy link
Collaborator Author

Hi @AlirezaHaghshenas

  1. I wonder could we revert the change back after the build in a post build hook? (Is this a horrible thing to do? :thinking_face: )
  2. We could do this action only when making releases or pre-view builds, so it doesn't happen when a developer is building locally (this will negate idea 1 above)
  3. Let's not commit the updated hash, we can set it at build, but in git it should only ever be a placeholder
  4. Sounds good, but for preview builds you might have to handle it differently. You have two cases, real releases (which we still do semi-manually) and preview builds. For preview builds, I think the version should contain the branch name and git short hash.

@jevonearth jevonearth linked a pull request Mar 10, 2021 that will close this issue
6 tasks
@Innkst Innkst modified the milestones: v8.1, v8.2 Mar 24, 2021
@kjaiswal kjaiswal self-assigned this Apr 6, 2021
@kjaiswal kjaiswal linked a pull request Apr 15, 2021 that will close this issue
6 tasks
@roxaneletourneau roxaneletourneau modified the milestones: v9.1, v9.0.1 May 11, 2021
@ac10n ac10n moved this to Done in Taquito Dev Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
5 participants