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

Project and VCS repository #10

Closed
svengreb opened this issue Nov 15, 2020 · 0 comments · Fixed by #11
Closed

Project and VCS repository #10

svengreb opened this issue Nov 15, 2020 · 0 comments · Fixed by #11

Comments

@svengreb
Copy link
Owner

svengreb commented Nov 15, 2020

In #9 the store and configuration for applications has been implemented. In wand applications are not standalone but part of a project which in turn is stored in a repository of a VCS like Git. In case of wand this can also be a monorepo to manage multiple applications, but there is always only a single project which all these applications are part of.
To store project and VCS repository information, some of the newly implemented packages will provide the following types:

  • 🆃 pkg/project.Metadata — A struct type that stores information and metadata of a project.
  • 🆃 pkg/project.GoModuleID — A struct type that stores partial information to identify a Go module.
  • 🆃 pkg/vcs.Kind — A struct type that defines the kind of a pkg/vcs.Repository.
  • 🅸 pkg/vcs.Repository — A interface type to represents a VCS repository that provides methods to receive repository information:
    • Kind() Kind — returns the repository pkg/vcs.Kind.
    • DeriveVersion() error — derives the repository version based on the pkg/vcs.Kind.
    • Version() interface{} — returns the repository version.
  • 🆃 pkg/vcs/git.Git — A struct type that implements pkg/vcs.Repository to represent a Git repository.
  • 🆃 pkg/vcs/git.Version — A struct type that stores version information and metadata derived from a Git repository.
  • 🆃 pkg/vcs/none.None — A struct type that implements pkg/vcs.Repository to represent a nonexistent repository.
@svengreb svengreb added this to the 0.1.0 milestone Nov 15, 2020
@svengreb svengreb self-assigned this Nov 15, 2020
svengreb added a commit that referenced this issue Nov 15, 2020
In GH-9 [1] the store and configuration for applications has been
implemented. In "wand" applications are not standalone but part of a
project which in turn is stored in a repository of a VCS like Git [2].
In case of "wand" this can also be a monorepo [3] to manage multiple
applications, but there is always only a single project which all these
applications are part of.
To store project and VCS repository information, some of the newly
implemented packages provide the following types:

- <T> "pkg/project.Metadata" - A "struct" type that stores information
  and metadata of a project.
- <T> "pkg/project.GoModuleID" - A "struct" type that stores partial
  information to identify a Go module [4].
- <T> "pkg/vcs.Kind" - A "struct" type that defines the kind of a
  "pkg/vcs.Repository".
- <I> "pkg/vcs.Repository" - A "interface" type to represents a VCS
  repository that provides methods to receive repository information:
  - "Kind() Kind" - returns the repository "pkg/vcs.Kind".
  - "DeriveVersion() error" - derives the repository version based on
    the "pkg/vcs.Kind".
  - "Version() interface{}" - returns the repository version.
- <T> "pkg/vcs/git.Git" - A "struct" type that implements
  "pkg/vcs.Repository" to represent a Git [5] repository.
- <T> "pkg/vcs/git.Version" - A "struct" type that stores version
  information and metadata derived from a Git [5] repository.
- <T> "pkg/vcs/none.None" - A "struct" type that implements
  "pkg/vcs.Repository" to represent a nonexistent repository.

[1]: #9
[2]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
[3]: https://trunkbaseddevelopment.com/monorepos
[4]: https://golang.org/ref/mod
[5]: https://git-scm.com

GH-10
svengreb added a commit that referenced this issue Nov 16, 2020
Instead of surrounding the "switch/case" block, that checkt the
repository version based on the underlying VCS, with a "if" block to
handle the case where no repository type is set, it no simply includes
the "none" VCS kind as a noop case.

Also the returned error now simply creates a new error instead of
formatting the error message as new error.

GH-10
svengreb added a commit that referenced this issue Nov 16, 2020
Wrapped all error returned from external package to prevent errors
become part of the public API.

Also the maximum search amount of suitable Git tag candidates in all
commits of the current has been extracte into a constant.

GH-10
svengreb added a commit that referenced this issue Nov 16, 2020
In GH-9 [1] the store and configuration for applications has been
implemented. In "wand" applications are not standalone but part of a
project which in turn is stored in a repository of a VCS like Git [2].
In case of "wand" this can also be a monorepo [3] to manage multiple
applications, but there is always only a single project which all these
applications are part of.
To store project and VCS repository information, some of the newly
implemented packages provide the following types:

- <T> "pkg/project.Metadata" - A "struct" type that stores information
  and metadata of a project.
- <T> "pkg/project.GoModuleID" - A "struct" type that stores partial
  information to identify a Go module [4].
- <T> "pkg/vcs.Kind" - A "struct" type that defines the kind of a
  "pkg/vcs.Repository".
- <I> "pkg/vcs.Repository" - A "interface" type to represents a VCS
  repository that provides methods to receive repository information:
  - "Kind() Kind" - returns the repository "pkg/vcs.Kind".
  - "DeriveVersion() error" - derives the repository version based on
    the "pkg/vcs.Kind".
  - "Version() interface{}" - returns the repository version.
- <T> "pkg/vcs/git.Git" - A "struct" type that implements
  "pkg/vcs.Repository" to represent a Git [5] repository.
- <T> "pkg/vcs/git.Version" - A "struct" type that stores version
  information and metadata derived from a Git [5] repository.
- <T> "pkg/vcs/none.None" - A "struct" type that implements
  "pkg/vcs.Repository" to represent a nonexistent repository.

[1]: #9
[2]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
[3]: https://trunkbaseddevelopment.com/monorepos
[4]: https://golang.org/ref/mod
[5]: https://git-scm.com

Closes GH-10
@svengreb svengreb removed their assignment Nov 16, 2020
svengreb added a commit that referenced this issue Nov 21, 2020
In GH-10 [1] two types were implemented to derive and handle version
information of a Git [2] repository:

- 🆃 `pkg/vcs/git.Version` - A `struct` type that stores version
  information and metadata derived from a Git [2] repository.
- 🆃 `pkg/vcs/git.deriveVersion` - A `func` type that derives version
  information and metadata from a Git [2] repository.

The logic has been extracted into the pkg/vcs/git [3] package of the
"github.com/svengreb/golib" [4] module and therefore both types have
been replaced with this new module.

[1]: #10
[2]: https://git-scm.com
[3]: https://pkg.go.dev/github.com/svengreb/golib/pkg/vcs/git
[4]: https://pkg.go.dev/github.com/svengreb/golib

GH-18
svengreb added a commit that referenced this issue Nov 21, 2020
In GH-10 [1] two types were implemented to derive and handle version
information of a Git [2] repository:

- 🆃 `pkg/vcs/git.Version` - A `struct` type that stores version
  information and metadata derived from a Git [2] repository.
- 🆃 `pkg/vcs/git.deriveVersion` - A `func` type that derives version
  information and metadata from a Git [2] repository.

The logic has been extracted into the pkg/vcs/git [3] package of the
"github.com/svengreb/golib" [4] module and therefore both types have
been replaced with this new module.

[1]: #10
[2]: https://git-scm.com
[3]: https://pkg.go.dev/github.com/svengreb/golib/pkg/vcs/git
[4]: https://pkg.go.dev/github.com/svengreb/golib

GH-18
svengreb added a commit that referenced this issue Nov 21, 2020
In GH-10 [1] two types were implemented to derive and handle version
information of a Git [2] repository:

- 🆃 `pkg/vcs/git.Version` - A `struct` type that stores version
  information and metadata derived from a Git [2] repository.
- 🆃 `pkg/vcs/git.deriveVersion` - A `func` type that derives version
  information and metadata from a Git [2] repository.

The logic has been extracted into the pkg/vcs/git [3] package of the
"github.com/svengreb/golib" [4] module and therefore both types have
been replaced with this new module.

[1]: #10
[2]: https://git-scm.com
[3]: https://pkg.go.dev/github.com/svengreb/golib/pkg/vcs/git
[4]: https://pkg.go.dev/github.com/svengreb/golib

Closes GH-18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant