Skip to content

Commit

Permalink
Remove magefile related code (#89)
Browse files Browse the repository at this point in the history
## Description

Remove documentation related to Magefile so newcomers to the repo aren't confused by a tool we haven't streamlined use of.

Related to #43.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update

## How Has This Been Tested?
Follow the instructions in [docs/development/README.md](docs/development/README.md)

1. `make test_all` after all relevant dependency updates
2. Ran a `LocalNet` following the instructions in the README.
  • Loading branch information
Olshansk authored Jun 8, 2022
1 parent a26e0a4 commit 5682e9a
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 152 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# TODO(pocket/issues/43): Delete this files after moving the necessary helpers to mage.go.

CWD ?= CURRENT_WORKING_DIRECTIONRY_NOT_SUPPLIED

# This flag is useful when running the consensus unit tests. It causes the test to wait up to the
Expand Down Expand Up @@ -40,13 +38,9 @@ go_staticcheck:

.PHONY: go_clean_deps
## Runs `go mod tidy` && `go mod vendor`
go_clean_deps:
go mod tidy && go mod vendor

.PHONY: build
## Build Pocket's main entrypoint
build:
mage build

.PHONY: build_and_watch
## Continous build Pocket's main entrypoint as files change
build_and_watch:
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ The official implementation of the [V1 Pocket Network Protocol Specification](ht

All the links you'll need are listed below. If you'd like to contribute to the Pocket V1 Protocol, start by:

1. Reading the **Contribution Guide**
2. Get things running by reading the **Development Guide**
3. Dive into any of the other guides or modules depending on what your interests are
1. Reading the [Contribution Guide](docs/contributing/CONTRIBUTING.md)
2. Get things running by reading the [Development Guide](docs/development/README.md)
3. Dive into any of the other guides or modules depending on where your interests lie

<!--
The list of documents below was created by manually curating the output of the following command:
Expand All @@ -31,6 +31,7 @@ All the links you'll need are listed below. If you'd like to contribute to the P
- [Development Guide](docs/development/README.md)
- [Testing Guide](docs/testing/README.md)
- [Dependencies Guide](docs/deps/README.md)
- [Build Guide](docs/build/README.md)

### Architectures

Expand All @@ -44,6 +45,8 @@ All the links you'll need are listed below. If you'd like to contribute to the P

- [Consensus Changelog](consensus/CHANGELOG.md)
- [Utility Changelog](utility/CHANGELOG.md)
- _Coming Soon: P2P Changelog_
- _Coming Soon: Persistence Changelog_

## Support & Contact

Expand Down
4 changes: 2 additions & 2 deletions app/pocket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/pokt-network/pocket/shared/config"
)

// See `docs/deps/README.md` for details on how this is injected via mage.
// See `docs/build/README.md` for details on how this is injected via mage.
var version = "UNKNOWN"

func main() {
Expand All @@ -17,7 +17,7 @@ func main() {
flag.Parse()

if *v {
log.Println(version)
log.Printf("Version flag currently unused %s\n", version)
return
}

Expand Down
17 changes: 17 additions & 0 deletions docs/build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build System

The build system we're using, mage, has been introduced with four targets; testing it involves invoking them and looking at their output.

## Versioning

All the targets that produce a binary should inject version information on it, which can be inspected by running the executable with the `-version` flag.

If built outside a repository, or without the `git` executable in the path, it should report the version `UNKNOWN`.

If built in a repository where uncommitted changes are present, the version should report a version with `+dirty`

Version reported for a proper git repository with the `git` executable present in the path should be `0.0.0-branch_name/commit_hash`, where the version number is fixed but the branch name reflects the current branch and the commit hash likewise the current commit's hash.

## Magefile build system

Once the V1 implementation reaches the stage of testable binaries, we are looking to use [Mage](https://magefile.org/) which is being tracked in [pocket/issues/43](https://github.com/pokt-network/pocket/issues/43) that'll inject a version with the `-version` flag.
38 changes: 2 additions & 36 deletions docs/deps/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,7 @@
# Table of Contents

1. [Mage](#mage)
2. [Reflex](#reflex)
3. [Go-ECVRF](#go-ecvrf)

# Mage

We currently depend on [mage](https://magefile.org/) as a build tool.

We wanted to reduce the possibility of human error in the creation of releases and get information about the source of the binary for troubleshooting scenarios.

To introduce automation in version generation there are several strategies, the simplest of which involves setting the version information at build time through flags sent to the Go toolchain linker.

Generating version information in general, and generating releases in particular, will use algorithms that can vary in complexity and amount of tasks automated.

In order to facilitate usage for the whole team, choosing a tool that is programmed in Go instead of a domain specific language seems sensible.

Usage in this case means:

- Ease of understanding the algorithms used for targets
- Ease of adding targets
- Ease of modifying targets

Hence, mage.

## Risk Assessment

### On the plus side

- Mage is licensed with Apache 2.0, implying that the copyright burdens of using it and even maintain a fork if it came to that are manageable
- Mage is used by Hugo, which is a big project unrelated to the maintainer; this hints at a group of people that will want to keep the project viable besides us (hugo has over 700 contributors)
- Mage 1.0 was released in 2017, and has seen releases often (18 at the time of writing); it is, therefore, relatively mature and seems healthy development activity wise
- Being a build tool, not part of the meat of the project, the impact of risks in the future of the tool are mitigated

### On the minus side

- The maintainer does not include information for support contracts, although they accept donations.
1. [Reflex](#reflex)
2. [Go-ECVRF](#go-ecvrf)

# Reflex

Expand Down
8 changes: 3 additions & 5 deletions docs/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ Pocket
├── build # Build related source files including Docker, scripts, etc
| ├── config # Configuration files for to run nodes in development
| ├── deployments # Docker-compose to run different cluster of services for development
| ├── Docker* # Various Dockerfiles
| ├── Docker* # Various Dockerfile(s)
├── consensus # Implementation of the Consensus module
├── core # [currently-unused]
├── docs # Links to V1 Protocol documentation (except the protocol specification)
├── docs # Links to V1 Protocol implementation documentation (excluding the protocol specification)
├── p2p # Implementation of the P2P module
├── persistence # Implementation of the Persistence module
├── prototype # [to-be-deleted] A snapshot of the very first v1 prototype
├── shared # [to-be-refactored] Shared types, modules and utils
├── utility # Implementation of the Persistence module
├── utility # Implementation of the Utility module
├── Makefile # [to-be-deleted] The source of targets used to develop, build and test
├── mage.go # [currently-unused] The future source of targets used to develop, build and test
```
34 changes: 0 additions & 34 deletions docs/testing/README.md

This file was deleted.

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/golang/mock v1.6.0
github.com/jackc/pgx/v4 v4.15.0
github.com/jordanorelli/lexnum v0.0.0-20141216151731-460eeb125754
github.com/magefile/mage v1.12.1
github.com/manifoldco/promptui v0.9.0
github.com/stretchr/testify v1.7.0
github.com/syndtr/goleveldb v1.0.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magefile/mage v1.12.1 h1:oGdAbhIUd6iKamKlDGVtU6XGdy5SgNuCWn7gCTgHDtU=
github.com/magefile/mage v1.12.1/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
Expand Down
62 changes: 0 additions & 62 deletions mage.go

This file was deleted.

0 comments on commit 5682e9a

Please sign in to comment.