From 126b2fc99f99c0f89785c4ba30d16c67400668fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Mon, 11 May 2026 13:32:18 +0200 Subject: [PATCH] docs: update README status table and Gitea helper docs Add missing deployment.revision and history fields to the README API reference table. Expand Gitea integration docs with full helper function signatures, functional options, and defaults. --- README.md | 2 ++ docs/development/gitea-integration.md | 44 ++++++++++++++++++++------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5e505e6..ff503ff 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and contr | `git.lastChecked` | timestamp | Last time the repository was checked | | `deployment.image` | string | Container image of the deployed function | | `deployment.imageBuilt` | timestamp | When the current image was built | +| `deployment.revision` | string | Current revision of the deployed service | | `deployment.deployer` | string | Tool/method used to deploy the function (e.g., "func") | | `deployment.runtime` | string | Detected function runtime | | `middleware.current` | string | Current middleware version in use | @@ -318,6 +319,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and contr | `middleware.lastRebuild` | timestamp | Last time the function was rebuilt for middleware updates | | `service.url` | string | URL of the function's service | | `service.ready` | string | Whether the function's service is ready (e.g., "true", "false", "UNKNOWN") | +| `history` | array | Last 20 reconciliation events with timestamp and message | #### Status Conditions diff --git a/docs/development/gitea-integration.md b/docs/development/gitea-integration.md index 13b5417..2c47dc7 100644 --- a/docs/development/gitea-integration.md +++ b/docs/development/gitea-integration.md @@ -44,17 +44,39 @@ BeforeEach(func() { ### Available Helper Methods **RepositoryProvider Interface:** -- `CreateUser(username, password, email string) (cleanup func(), err error)` - Create user with cleanup function -- `CreateRandomUser() (username, password, email string, cleanup func(), err error)` - Create user with random credentials -- `CreateRepo(owner, name string, private bool) (url string, cleanup func(), err error)` - Create repository -- `CreateRandomRepo(owner string, private bool) (name, url string, cleanup func(), err error)` - Create repo with random name -- `CreateAccessToken(username, password, tokenName string) (string, error)` - Generate access token -- `CreateSSHKey(username, password, title, publicKey string) error` - Register SSH public key for user -- `SSHRepoURL(owner, repo string) (string, error)` - Get SSH URL for a repository - -**E2E Helper Functions:** -- `InitializeRepoWithFunction(url, user, pass, lang)` - Clone, init function, push -- `CommitAndPush(repoDir, msg, file, ...otherFiles)` - Commit and push files +- `CreateUser(username, password, email string) (cleanup func(), err error)` — Create user with cleanup function +- `DeleteUser(username string) error` — Delete a user and all their data +- `CreateRandomUser() (username, password, email string, cleanup func(), err error)` — Create user with random credentials +- `CreateRepo(owner, name string, private bool) (url string, cleanup func(), err error)` — Create repository +- `DeleteRepo(owner, name string) error` — Delete a repository +- `CreateRandomRepo(owner string, private bool) (name, url string, cleanup func(), err error)` — Create repo with random name +- `CreateAccessToken(username, password, tokenName string) (string, error)` — Generate access token +- `CreateSSHKey(username, password, title, publicKey string) error` — Register SSH public key for user +- `SSHRepoURL(owner, repo string) (string, error)` — Get SSH URL for a repository + +Note: `CreateUser`, `CreateRepo`, and `CreateRandomRepo` return cleanup functions that call `DeleteUser`/`DeleteRepo` internally. Prefer `DeferCleanup(cleanup)` over calling the delete methods directly. + +**Git Helper Functions:** +- `InitializeRepoWithFunction(url, user, pass, lang string, opts ...RepoOption) (repoDir string, err error)` — Clone, init function, push +- `CommitAndPush(repoDir, msg, file string, otherFiles ...string) error` — Commit and push files + +`InitializeRepoWithFunction` accepts functional options: +- `WithSubDir(subDir string)` — Place the function in a subdirectory (for monorepo testing) +- `WithCliVersion(version string)` — Use a specific func CLI version to initialize the function + +**func CLI Helper Functions:** +- `RunFunc(command string, args ...string) (string, error)` — Run the current/latest func CLI +- `RunFuncWithVersion(version, command string, args ...string) (string, error)` — Run a specific func CLI version (downloads and caches automatically) +- `RunFuncDeploy(functionDir string, opts ...FuncDeployOption) (string, error)` — Deploy a function with retry logic + +`RunFuncDeploy` accepts functional options: +- `WithNamespace(namespace string)` — Target namespace +- `WithBuilder(builder string)` — Builder to use (e.g. `pack`, `s2i`) +- `WithDeployer(deployer string)` — Deployer to use (e.g. `knative`, `keda`) +- `WithDeployCliVersion(version string)` — Use a specific func CLI version +- `WithEnvVars(envVars map[string]string)` — Set environment variables for the deploy command + +Defaults for `RunFuncDeploy` are read from environment variables: `REGISTRY` (or `REGISTRY_URL`), `REGISTRY_INSECURE`, `DEFAULT_BUILDER`, `DEFAULT_DEPLOYER`. ### DeferCleanup Pattern