-
Notifications
You must be signed in to change notification settings - Fork 0
fea: Codex library integration #1
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
Open
2-towns
wants to merge
8
commits into
master
Choose a base branch
from
feat/go-library-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a74ac84
Add codex library integration
2-towns f8b673c
Try to fix ci
2-towns a97d2ea
Increase test timeout
2-towns 3d00c81
Update ci
2-towns 100ca35
Apply PR reviews
2-towns 95d5bf8
tidy go.mod
marcinczenko 722d67e
Use CodexManifest and CodexConfig types instead of exposing codex.
2-towns b3bd9a1
Update codex version to support cancellation
2-towns File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,5 @@ coverage*.cov | |
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| libs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| { | ||
| "go.testTags": "codex_integration", | ||
| "gopls": { | ||
| "buildFlags": ["-tags=codex_integration"] | ||
| "buildFlags": [ | ||
| "-tags=codex_integration" | ||
| ] | ||
| }, | ||
| "go.toolsEnvVars": { | ||
| "CGO_ENABLED": "1", | ||
| "CGO_CFLAGS": "-I${workspaceFolder}/libs", | ||
| "CGO_LDFLAGS": "-L${workspaceFolder}/libs -lcodex -Wl,-rpath,${workspaceFolder}/libs" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Destination folder for the downloaded libraries | ||
| LIBS_DIR := $(abspath ./libs) | ||
|
|
||
| # Flags for CGO to find the headers and the shared library | ||
| UNAME_S := $(shell uname -s) | ||
| CGO_CFLAGS := -I$(LIBS_DIR) | ||
| CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) | ||
|
|
||
| ifeq ($(OS),Windows_NT) | ||
| BIN_NAME := codex-go.exe | ||
| else | ||
| BIN_NAME := codex-go | ||
| endif | ||
|
|
||
| # Configuration for fetching the right binary | ||
| OS ?= "linux" | ||
| ARCH ?= "amd64" | ||
| VERSION ?= "v0.0.24" | ||
| DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip" | ||
|
|
||
| fetch: | ||
| @echo "Fetching libcodex from GitHub Actions from: ${DOWNLOAD_URL}" | ||
| curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${DOWNLOAD_URL} | ||
| unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR) | ||
| rm -f $(LIBS_DIR)/*.zip | ||
|
|
||
| build-upload: | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o bin/codex-upload ./cmd/upload | ||
|
|
||
| build-download: | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o bin/codex-download ./cmd/download | ||
|
|
||
| build: build-upload build-download | ||
|
|
||
| test: | ||
| @echo "Running unit tests..." | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" gotestsum --packages="./communities" -f standard-verbose -- -v | ||
|
|
||
| test-ci: | ||
| @echo "Running unit tests..." | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" gotestsum --packages="./communities" -f standard-verbose -- -race -v | ||
|
|
||
| test-integration: | ||
| @echo "Running tests..." | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" gotestsum --packages="./communities" -f standard-verbose -- -tags=codex_integration -run Integration -timeout 60s | ||
|
|
||
| coverage: | ||
| @echo "Running unit tests with coverage..." | ||
| CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -coverprofile=coverage.out ./communities | ||
| go tool cover -func=coverage.out | ||
|
|
||
| clean: | ||
| rm -f $(BIN_NAME) | ||
| rm -Rf $(LIBS_DIR)/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.