SlideShare a Scribd company logo
1 of 18
Download to read offline
Understanding Pseudo-Versions
Moving to Go 1.13
What is in Go 1.14+ for Modules
By Mitali Bisht
WHO AM I ?
Mitali Bisht
Software Engineer @JFrog
GoCenter.io Developer
@EngrMitaliB
#gocenter
●
●
●
https://bit.ly/GolangDCJFrog
BY THE END OF THIS TALK YOU WILL KNOW
▪ About pseudo-versions
▪ Go 1.13 pseudo-version verification
▪ Fixing Incorrect pseudo-versions for Go Modules
▪ What is Go 1.14+ bringing for modules
WHAT IS A GO MODULE?
module github.com/containers/common
go 1.12
require (
github.com/BurntSushi/toml v0.3.1
github.com/containers/image/v5 v5.4.3
github.com/containers/storage v1.19.1
github.com/opencontainers/runc v1.0.0-rc9
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 //
indirect
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
….
)
Release versions (Semantic Versions)
• A module is a collection of Go packages stored in a file tree with a go.mod file at its root. The
go.mod file defines the module’s module path, which is also the import path used for the root
directory, and its dependency requirements, which are the other modules needed for a
successful build. Each dependency requirement is written as a module path and a specific
semantic version
•
•Go command uses Semantic version vX.Y.Z as the standard form to describe Module version
X- MAJOR- Incompatible changes
Y- Minor- Backward compatible functionality added
Z - PATH- Backwards compatible bug fixes
•
•Normal releases are being preferred by Go
•Module version is introduced by tagging a revision in source repo
WHAT IS A GO MODULE?
module github.com/containers/common
go 1.12
require (
github.com/BurntSushi/toml v0.3.1
github.com/containers/image/v5 v5.4.3
github.com/containers/storage v1.19.1
github.com/opencontainers/runc v1.0.0-rc9 Pre-release version
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 //
indirect
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
….
)
WHAT IS A GO MODULE?
module github.com/containers/common
go 1.12
require (
github.com/BurntSushi/toml v0.3.1
github.com/containers/image/v5 v5.4.3
github.com/containers/storage v1.19.1
github.com/opencontainers/runc v1.0.0-rc9
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 //
indirect
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 Pseudo-versions
….
)
USING PSEUDO-VERSIONS
▪ Untagged revision
▪ Dependent project has not published any semantic version tags
▪ Develop against a commit which has not been tagged yet
•The go command will accept the plain commit hash and translate it into a pseudo-version (or
a tagged version if available) automatically. It also helps to compare the revisions based on
generated timestamp. This is an example of gomodule query
•There are pseudo-versions that are edited by hand or generated by third party tools
•Through Go 1.12, Pseudo-version with arbitrary combination of version string and date, would
resolve to the underlying revision (typically a Git commit hash) as long as that revision existed
by Go
DON’T UPDATE PSEUDO-VERSIONS MANUALLY
● The pseudo-version participates in minimal version selection.
● The commit date within the pseudo-version provides a total order among
pseudo-versions.
The pseudo-version participates in minimal version selection. If its version prefix is inaccurate,
the pseudo-version may appear to have higher precedence that the releases that follow it,
effectively “pinning” the module to that commit.
BEFORE GO 1.13 AFTER GO 1.13
-> go version
go version go1.13.5 darwin/amd64
-> go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a
go: finding golang.org
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a:
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a: invalid pseudo-version: does not
match version-control timestamp
(2019-08-13T06:44:41Z)
-> go version
go version go1.12.14 darwin/amd64
-> go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a
go: finding golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: downloading golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: extracting golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x/sys latest
-> cat go.mod
module demo/go12
go 1.12
require golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a //
indirect
GO 1.13 PSEUDO-VERSIONS VALIDATION
module github.com/containers/common
go 1.12
require (
github.com/BurntSushi/toml v0.3.1
github.com/containers/image/v5 v5.4.3
github.com/containers/storage v1.19.1
github.com/opencontainers/runc v1.0.0-rc9
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 //
indirect
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
…..
)
1. 3.2.
1. The tag from which the pseudo-version derives points to the named revision or one of
its ancestors as reported by the underlying VCS tool, or the pseudo-version is not
derived from any tag i.e. has a "vX.0.0-" prefix before the date string and uses the
lowest major version appropriate to the module path).
2. The date string within the pseudo-version matches the UTC timestamp of the revision
as reported by the underlying VCS tool.
3. The short name of the revision within the pseudo-version is the same as the short
name generated by Go command. Specifically, if the short name is a SHA-1 prefix, it
must use the same number of hex digits (12)
GO 1.13 PSEUDO-VERSIONS VALIDATION
4. '+incompatible' suffix
5. Checksum server validation
4. The pseudo-version includes a '+incompatible' suffix only if it is needed for the
corresponding major version, and only if the underlying module does not have a go.mod file
5 . In each module's root, alongside go.mod, the go command maintains a file named go.sum
containing the cryptographic checksums of the module's dependencies. As of Go1.13, with go
get command it will validate module version against checksum server(which is a transparent
log of all public module checksums)
FIXING INCORRECT PSEUDO-VERSIONS
● Direct dependencies
● Transitive dependencies
replace golang.org/x/sys v0.0.0-20190726091711-fde4db37ae7a
=> golang.org/x/sys fde4db37ae7a
require {
golang.org/x/sys fde4db37ae7a
}
HOW GoCenter AS GOPROXY CAN HELP
▪ GoCenter changes the metadata in the .info with the correct version when the
module download was requested for incorrect pseudo-version.
BEFORE GO 1.13 AFTER GO 1.13
-> export GOPROXY=https://gocenter.io/
-> go version
go version go1.13.5 darwin/amd64
-> go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a
go: finding golang.org/x
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org
v0.0.0-20190726091023-fde4db37ae7a
go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a:
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a: proxy returned info for version
v0.0.0-20190813064441-fde4db37ae7a instead
of requested version
-> export GOPROXY=https://gocenter.io/
-> go version
go version go1.12.14 darwin/amd64
-> go get
golang.org/x/sys@v0.0.0-20190726091023-fde4d
b37ae7a
go: finding golang.org/x/sys
v0.0.0-20190726091023-fde4db37ae7a
go: finding golang.org/x/sys
v0.0.0-20200515095857-1151b9dac4a9
go: downloading golang.org/x/sys
v0.0.0-20200515095857-1151b9dac4a9
go: extracting golang.org/x/sys
v0.0.0-20200515095857-1151b9dac4a9
-> cat go.mod
module proxydemo/go12
go 1.12
require golang.org/x/sys
v0.0.0-20190813064441-fde4db37ae7a //
indirect
HOW GoCenter AS GOPROXY CAN HELP
▪ For Go 1.13 change in Go Command will automatically update correct
pseudo-version
go get <module_name>@<commit_hash>
WHAT IS IN GO 1.14+ FOR MODULES ?
● go get -modfile = /Documents/example1.mod
● go get -mod = readonly /path/to/module
● “go get” upgrade to an +incompatible major version automatically
● plain-text error messages from module proxies and other HTTP servers
● SVN
Questions?
@EngrMitaliB
#gocenter
https://bit.ly/GolangDCJFrog

More Related Content

What's hot

Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at EclipseChris Aniszczyk
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersMartin Jinoch
 
Git inter-snapshot public
Git  inter-snapshot publicGit  inter-snapshot public
Git inter-snapshot publicSeongJae Park
 
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Codemotion
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commandsIsham Rashik
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitJuanma Orta
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshareCavelle Benjamin
 
Coding with golang
Coding with golangCoding with golang
Coding with golangHannahMoss14
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSSeongJae Park
 
Version Control With GitHub & RStudio
Version Control With GitHub & RStudioVersion Control With GitHub & RStudio
Version Control With GitHub & RStudioRsquared Academy
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environmentsArtem Kovardin
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 

What's hot (19)

Git training with Devaamo
Git training with DevaamoGit training with Devaamo
Git training with Devaamo
 
Let's Contribute
Let's ContributeLet's Contribute
Let's Contribute
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at Eclipse
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 
Git inter-snapshot public
Git  inter-snapshot publicGit  inter-snapshot public
Git inter-snapshot public
 
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commands
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
 
Coding with golang
Coding with golangCoding with golang
Coding with golang
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
I docstools
I docstoolsI docstools
I docstools
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
 
Version Control With GitHub & RStudio
Version Control With GitHub & RStudioVersion Control With GitHub & RStudio
Version Control With GitHub & RStudio
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environments
 
Git and Testing
Git and TestingGit and Testing
Git and Testing
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 

Similar to Understanding pseudo-version and Go1.14+ with notes

Security of Go Modules - SF Meetup
Security of Go Modules - SF MeetupSecurity of Go Modules - SF Meetup
Security of Go Modules - SF MeetupDeep Datta
 
Security of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterSecurity of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterDeep Datta
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeDeep Datta
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeDeep Datta
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeDeep Datta
 
Security of Go Modules and Vulnerability Scanning in VSCode
Security of Go Modules and Vulnerability Scanning in VSCodeSecurity of Go Modules and Vulnerability Scanning in VSCode
Security of Go Modules and Vulnerability Scanning in VSCodeDeep Datta
 
New Security of Go modules and vulnerability scanning in GoCenter
New Security of Go modules and vulnerability scanning in GoCenterNew Security of Go modules and vulnerability scanning in GoCenter
New Security of Go modules and vulnerability scanning in GoCenterDeep Datta
 
GTG30: Introduction vgo
GTG30: Introduction vgoGTG30: Introduction vgo
GTG30: Introduction vgoEvan Lin
 
Security of go modules and vulnerability scanning in go center (1)
Security of go modules and vulnerability scanning in go center (1)Security of go modules and vulnerability scanning in go center (1)
Security of go modules and vulnerability scanning in go center (1)Deep Datta
 
Security of Go Modules and Vulnerability Scanning in Go center and VSCodee
Security of Go Modules and Vulnerability Scanning in Go center and VSCodeeSecurity of Go Modules and Vulnerability Scanning in Go center and VSCodee
Security of Go Modules and Vulnerability Scanning in Go center and VSCodeeDeep Datta
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golangRamit Surana
 
Security of Go Modules and Vulnerability Scanning in Go Center
Security of Go Modules and Vulnerability Scanning in Go CenterSecurity of Go Modules and Vulnerability Scanning in Go Center
Security of Go Modules and Vulnerability Scanning in Go CenterDeep Datta
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
You can git
You can gitYou can git
You can gitYu GUAN
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Codemotion
 

Similar to Understanding pseudo-version and Go1.14+ with notes (20)

Security of Go Modules - SF Meetup
Security of Go Modules - SF MeetupSecurity of Go Modules - SF Meetup
Security of Go Modules - SF Meetup
 
Security of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenterSecurity of go modules and vulnerability scanning in GoCenter
Security of go modules and vulnerability scanning in GoCenter
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
 
Security of Go Modules and Vulnerability Scanning in VSCode
Security of Go Modules and Vulnerability Scanning in VSCodeSecurity of Go Modules and Vulnerability Scanning in VSCode
Security of Go Modules and Vulnerability Scanning in VSCode
 
New Security of Go modules and vulnerability scanning in GoCenter
New Security of Go modules and vulnerability scanning in GoCenterNew Security of Go modules and vulnerability scanning in GoCenter
New Security of Go modules and vulnerability scanning in GoCenter
 
GTG30: Introduction vgo
GTG30: Introduction vgoGTG30: Introduction vgo
GTG30: Introduction vgo
 
Security of go modules and vulnerability scanning in go center (1)
Security of go modules and vulnerability scanning in go center (1)Security of go modules and vulnerability scanning in go center (1)
Security of go modules and vulnerability scanning in go center (1)
 
Security of Go Modules and Vulnerability Scanning in Go center and VSCodee
Security of Go Modules and Vulnerability Scanning in Go center and VSCodeeSecurity of Go Modules and Vulnerability Scanning in Go center and VSCodee
Security of Go Modules and Vulnerability Scanning in Go center and VSCodee
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golang
 
Security of Go Modules and Vulnerability Scanning in Go Center
Security of Go Modules and Vulnerability Scanning in Go CenterSecurity of Go Modules and Vulnerability Scanning in Go Center
Security of Go Modules and Vulnerability Scanning in Go Center
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
You can git
You can gitYou can git
You can git
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Understanding pseudo-version and Go1.14+ with notes

  • 1. Understanding Pseudo-Versions Moving to Go 1.13 What is in Go 1.14+ for Modules By Mitali Bisht
  • 2. WHO AM I ? Mitali Bisht Software Engineer @JFrog GoCenter.io Developer @EngrMitaliB #gocenter
  • 4. BY THE END OF THIS TALK YOU WILL KNOW ▪ About pseudo-versions ▪ Go 1.13 pseudo-version verification ▪ Fixing Incorrect pseudo-versions for Go Modules ▪ What is Go 1.14+ bringing for modules
  • 5. WHAT IS A GO MODULE? module github.com/containers/common go 1.12 require ( github.com/BurntSushi/toml v0.3.1 github.com/containers/image/v5 v5.4.3 github.com/containers/storage v1.19.1 github.com/opencontainers/runc v1.0.0-rc9 github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 // indirect github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 …. ) Release versions (Semantic Versions) • A module is a collection of Go packages stored in a file tree with a go.mod file at its root. The go.mod file defines the module’s module path, which is also the import path used for the root directory, and its dependency requirements, which are the other modules needed for a successful build. Each dependency requirement is written as a module path and a specific semantic version • •Go command uses Semantic version vX.Y.Z as the standard form to describe Module version X- MAJOR- Incompatible changes Y- Minor- Backward compatible functionality added Z - PATH- Backwards compatible bug fixes • •Normal releases are being preferred by Go •Module version is introduced by tagging a revision in source repo
  • 6. WHAT IS A GO MODULE? module github.com/containers/common go 1.12 require ( github.com/BurntSushi/toml v0.3.1 github.com/containers/image/v5 v5.4.3 github.com/containers/storage v1.19.1 github.com/opencontainers/runc v1.0.0-rc9 Pre-release version github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 // indirect github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 …. )
  • 7. WHAT IS A GO MODULE? module github.com/containers/common go 1.12 require ( github.com/BurntSushi/toml v0.3.1 github.com/containers/image/v5 v5.4.3 github.com/containers/storage v1.19.1 github.com/opencontainers/runc v1.0.0-rc9 github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 // indirect github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 Pseudo-versions …. )
  • 8. USING PSEUDO-VERSIONS ▪ Untagged revision ▪ Dependent project has not published any semantic version tags ▪ Develop against a commit which has not been tagged yet •The go command will accept the plain commit hash and translate it into a pseudo-version (or a tagged version if available) automatically. It also helps to compare the revisions based on generated timestamp. This is an example of gomodule query •There are pseudo-versions that are edited by hand or generated by third party tools •Through Go 1.12, Pseudo-version with arbitrary combination of version string and date, would resolve to the underlying revision (typically a Git commit hash) as long as that revision existed by Go
  • 9. DON’T UPDATE PSEUDO-VERSIONS MANUALLY ● The pseudo-version participates in minimal version selection. ● The commit date within the pseudo-version provides a total order among pseudo-versions. The pseudo-version participates in minimal version selection. If its version prefix is inaccurate, the pseudo-version may appear to have higher precedence that the releases that follow it, effectively “pinning” the module to that commit.
  • 10. BEFORE GO 1.13 AFTER GO 1.13 -> go version go version go1.13.5 darwin/amd64 -> go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a go: finding golang.org v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a: golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a: invalid pseudo-version: does not match version-control timestamp (2019-08-13T06:44:41Z) -> go version go version go1.12.14 darwin/amd64 -> go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a go: finding golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: downloading golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: extracting golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x/sys latest -> cat go.mod module demo/go12 go 1.12 require golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a // indirect
  • 11. GO 1.13 PSEUDO-VERSIONS VALIDATION module github.com/containers/common go 1.12 require ( github.com/BurntSushi/toml v0.3.1 github.com/containers/image/v5 v5.4.3 github.com/containers/storage v1.19.1 github.com/opencontainers/runc v1.0.0-rc9 github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7 // indirect github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 ….. ) 1. 3.2. 1. The tag from which the pseudo-version derives points to the named revision or one of its ancestors as reported by the underlying VCS tool, or the pseudo-version is not derived from any tag i.e. has a "vX.0.0-" prefix before the date string and uses the lowest major version appropriate to the module path). 2. The date string within the pseudo-version matches the UTC timestamp of the revision as reported by the underlying VCS tool. 3. The short name of the revision within the pseudo-version is the same as the short name generated by Go command. Specifically, if the short name is a SHA-1 prefix, it must use the same number of hex digits (12)
  • 12. GO 1.13 PSEUDO-VERSIONS VALIDATION 4. '+incompatible' suffix 5. Checksum server validation 4. The pseudo-version includes a '+incompatible' suffix only if it is needed for the corresponding major version, and only if the underlying module does not have a go.mod file 5 . In each module's root, alongside go.mod, the go command maintains a file named go.sum containing the cryptographic checksums of the module's dependencies. As of Go1.13, with go get command it will validate module version against checksum server(which is a transparent log of all public module checksums)
  • 13. FIXING INCORRECT PSEUDO-VERSIONS ● Direct dependencies ● Transitive dependencies replace golang.org/x/sys v0.0.0-20190726091711-fde4db37ae7a => golang.org/x/sys fde4db37ae7a require { golang.org/x/sys fde4db37ae7a }
  • 14. HOW GoCenter AS GOPROXY CAN HELP ▪ GoCenter changes the metadata in the .info with the correct version when the module download was requested for incorrect pseudo-version.
  • 15. BEFORE GO 1.13 AFTER GO 1.13 -> export GOPROXY=https://gocenter.io/ -> go version go version go1.13.5 darwin/amd64 -> go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a go: finding golang.org/x v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org v0.0.0-20190726091023-fde4db37ae7a go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a: golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a: proxy returned info for version v0.0.0-20190813064441-fde4db37ae7a instead of requested version -> export GOPROXY=https://gocenter.io/ -> go version go version go1.12.14 darwin/amd64 -> go get golang.org/x/sys@v0.0.0-20190726091023-fde4d b37ae7a go: finding golang.org/x/sys v0.0.0-20190726091023-fde4db37ae7a go: finding golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 go: downloading golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 go: extracting golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 -> cat go.mod module proxydemo/go12 go 1.12 require golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
  • 16. HOW GoCenter AS GOPROXY CAN HELP ▪ For Go 1.13 change in Go Command will automatically update correct pseudo-version go get <module_name>@<commit_hash>
  • 17. WHAT IS IN GO 1.14+ FOR MODULES ? ● go get -modfile = /Documents/example1.mod ● go get -mod = readonly /path/to/module ● “go get” upgrade to an +incompatible major version automatically ● plain-text error messages from module proxies and other HTTP servers ● SVN