Appuio-odoo-adapter - ERP adapter for APPUiO Cloud

go-bootstrap

Build Go version Version Maintainability Coverage GitHub downloads

Template repository for common Go setups

Features

  • GitHub Workflows

    • Build (Go & Docker image)
    • Test (including CodeClimate)
    • Lint (Go)
    • Release (Goreleaser & Changelog generator)
  • GitHub issue templates

    • PR template
    • Issue templates using GitHub issue forms
  • Goreleaser

    • Go build for amd64, armv8
    • Docker build for latest and vx.y.z tags
    • Push Docker image to GitHub's registry ghcr.io
  • Antora documentation

    • Build default documentation with VSHN styling
    • Publish to GitHub Pages by default (opt-out)
    • Automated with GitHub workflows to build in master branch and (pre-)releases.
    • Available make targets are prefixed with docs-
  • Local Kubernetes environment

    • Setup Kubernetes-In-Docker (kind)
    • Prepares a kubeconfig file in .kind/
    • Optionally install NGINX as ingress controller
    • Available make targets are prefixed with kind-
  • CLI and logging framework

    • To help get you started with CLI subcommands, flags and environment variables
    • If you don't need subcommands, remove example_command.go and adjust cli.App settings in main.go

TODO's after generating from this template

TIP: You can search for these tasks using grep -n -r "TODO:" .

  1. go.mod: Adjust module name.
  2. .goreleaser.yml: Adjust Docker image location in dockers and docker_manifests parameters.
  3. .gitignore: Adjust binary file name.
  4. Dockerfile: Adjust binary file name.
  5. Makefile.vars.mk: Adjust project meta.
  6. .github/ISSUE_TEMPLATE/config.yml (optional): Enable forwarding questions to GitHub Discussions or other page.
  7. .github/workflows/test.yml: Update CodeClimate reporter ID (to be found in codeclimate.com Test coverage settings)
  8. docs/antora.yml: Adjust project meta.
  9. docs/antora-playbook.yml: Adjust project meta.
  10. docs/modules/pages/index.adoc: Edit start page.
  11. docs/modules/nav.adoc: Edit navigation.
  12. main.go: Adjust variables.
  13. Edit this README (including badges links)
  14. Start hacking in example_command.go.

After completing a task, you can remove the comment in the files.

Other repository settings

  1. GitHub Settings

    • "Options > Wiki" (disable)
    • "Options > Allow auto-merge" (enable)
    • "Options > Automatically delete head branches" (enable)
    • "Branches > Default branch" (change to master) (VSHN's default)
    • "Branches > Branch protection rules":
      • Branch name pattern: master
      • Require status check to pass before merging: ["lint"] (you may need to push come commits first)
  2. GitHub Issue labels

    • "Issues > Labels > New Label" for the following labels with color suggestions:
      • change (#D93F0B)
      • dependency (#ededed)
      • breaking (#FBCA04)
  3. CodeClimate Settings

    • "Repo Settings > GitHub > Pull request status updates" (install)
    • "Repo Settings > Test coverage > Enforce {Diff,Total} Coverage" (configure to your liking)

Antora documentation

This template comes with an Antora documentation module to help you create Asciidoctor documentation. By default, it is automatically published to GitHub Pages in gh-pages branch, however it can also be included in external Antora playbooks.

Setup GitHub Pages

Let's prepare and empty gh-pages branch, but make sure to commit or stash current changes first!

current_branch=$(git rev-parse --abbrev-ref HEAD)
initial_commit=$(git rev-list --max-parents=0 HEAD)
git switch --create gh-pages $initial_commit
git rm -r --cached .
git commit -m "Prepare gh-pages branch"
git push --set-upstream origin gh-pages
git switch -f $current_branch

And you're done! GitHub automatically recognizes and sets up Pages if there's a gh-pages branch.


If you want to skip deployment to GitHub Pages you need to delete specific files and references: rm -f .github/workflows/docs.yml docs/package*.json docs/antora-playbook.yml docs/antora-build.mk


If you want to remove documentation completely simply run rm -rf docs .github/workflows/docs.yml

Owner
VSHN AG
Swiss DevOps Engineering & Operations. Creators of APPUiO. OpenShift and Rancher specialists. Kubernetes Certified Service Provider (KCSP).
VSHN AG
Comments
  • "month" arguments '08' and '09' are broken

    Description

    The appuio-odoo-adapter does not work with month arguments '08' and '09'.

    This is because the 'cli' package's "IntFlag" does not use base 10 by default. Instead it auto-detects the base. In case of strings starting with '0', it assumes base 8, hence '08' and '09' are not parseable.

    The culprit is here: https://github.com/urfave/cli/blob/main/flag_int.go#L47 This code should use base 10 by default instead of 0 (auto-detect).

    Unfortunately this is not configurable, so I don't see an easy fix, but maybe I'm overlooking something. Personally I would completely remove the 'cli' library and do some simple environment variable parsing instead, but I presume some people will disagree with me on that.

    Additional Context

    I will try to find a workaround by changing the CronJob such that it supplies the month without leading zero, see https://github.com/appuio/component-appuio-cloud-reporting/blob/master/component/main.jsonnet#L195

    Logs

    Incorrect Usage: invalid value "08" for flag -month: parse error
    NAME:
    appuio-odoo-adapter invoice - Create Odoo invoices from APPUiO Cloud
    USAGE:
    appuio-odoo-adapter invoice [command options] [arguments...]
    OPTIONS:
    --odoo-url value Odoo ERP URL in the form of https://username:password@host[:port]/db-name (default: <required>) [$OA_ODOO_URL]
    --db-url value PostgreSQL URL in the form of postgres://username:password@host[:port]/db-name (default: <required>) [$OA_DB_URL]
    --year value Year to generate the report for. (default: 0) [$OA_YEAR]
    --month value Month to generate the report for. (default: 0) [$OA_MONTH]
    --invoice-defaults-path value Path to a file with invoice defaults. [$OA_INVOICE_DEFAULTS_PATH]
    --item-description-templates-path PRODUCT_SOURCE.gotmpl Path to a directory with templates. The Files must be named PRODUCT_SOURCE.gotmpl. (default: "description_templates/") [$OA_ITEM_DESCRIPTION_TEMPLATES_PATH]
    --help, -h show help (default: false)
    invalid value "08" for flag -month: parse error
    

    Expected Behavior

    The argument '08' gets parsed to integer 8, '09' gets parsed to integer 9.

    Steps To Reproduce

    Run appuio-odoo-adapter with argument "--month 08" or "--month 09".

    Versions

    v1.4.0

  • Add Templates for Exoscale DBaaS products

    Add Templates for Exoscale DBaaS products

    Summary

    Adds Templates for Exoscale DBaaS products.

    As there are over 100 DB/Plan combination (and in turn over 100 distinct products in the Billing DB) I extended the template selection to allow for only one template per DB type. This shouldn't impact the current billing behavior as we will do longest prefix match.

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
  • Add handlers for Invoice Categories

    Add handlers for Invoice Categories

    Summary

    • Short summary of what's included in the PR
    • Give special note to breaking changes

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
    • [x] Link this PR to related issues.
  • Tuning the compute usage template

    Tuning the compute usage template

    Summary

    Improve the formatting of the line item description for compute memory line items.

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
  • Add sub-items to invoice

    Add sub-items to invoice

    Summary

    Adds CPU request and Memory request sub-items to compute item, if they exist.

    Also slightly extends the golden tests.

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
  • Initial Odoo login

    Initial Odoo login

    Summary

    • Introduces sync command that logs in to Odoo instance

    Note: Currently either a port-forward or a public accessible URL is required. It cannot handle the oauth proxy login flow that is currently in front of Odoo.

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
  • Update module github.com/urfave/cli/v2 to v2.23.6

    Update module github.com/urfave/cli/v2 to v2.23.6

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/urfave/cli/v2 | require | patch | v2.23.5 -> v2.23.6 |


    Release Notes

    urfave/cli

    v2.23.6

    Compare Source

    What's Changed

    Full Changelog: https://github.com/urfave/cli/compare/v2.23.5...v2.23.6


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

  • Update module go.uber.org/zap to v1.24.0

    Update module go.uber.org/zap to v1.24.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | go.uber.org/zap | require | minor | v1.23.0 -> v1.24.0 |


    Release Notes

    uber-go/zap

    v1.24.0

    Compare Source

    Enhancements:

    • #​1148: Add Level to both Logger and SugaredLogger that reports the current minimum enabled log level.
    • #​1185: SugaredLogger turns errors to zap.Error automatically.

    Thanks to @​Abirdcfly, @​craigpastro, @​nnnkkk7, and @​sashamelentyev for their contributions to this release.


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

  • Update module github.com/Masterminds/sprig/v3 to v3.2.3

    Update module github.com/Masterminds/sprig/v3 to v3.2.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/Masterminds/sprig/v3 | require | patch | v3.2.2 -> v3.2.3 |


    Release Notes

    Masterminds/sprig

    v3.2.3

    Compare Source

    Changed


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

  • Always parse int flags (month, year) as base 10

    Always parse int flags (month, year) as base 10

    This allows passing months like 09.

    Fixes #57

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
    • [x] Link this PR to related issues.
  • Update templates for new Cloudscale node classes

    Update templates for new Cloudscale node classes

    Also see https://github.com/appuio/appuio-cloud-reporting/pull/90

    Checklist

    • [x] Categorize the PR by setting a good title and adding one of the labels: bug, enhancement, documentation, change, breaking, dependency as they show up in the changelog
    • [x] Update tests.
  • Update module github.com/appuio/appuio-cloud-reporting to v0.7.1

    Update module github.com/appuio/appuio-cloud-reporting to v0.7.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/appuio/appuio-cloud-reporting | require | patch | v0.7.0 -> v0.7.1 |


    Release Notes

    appuio/appuio-cloud-reporting

    v0.7.1

    Compare Source

    16 changes since v0.7.0

    🛠️ Minor Changes

    • Allow testing PromQL queries (#​110)

    🐛 Fixes

    • Fix queries if node class label is added (#​99)
    • Fix memory query on unrelated node label changes (#​105)
    • Fix query on PV info change (#​111)
    • Fix query on namespace label changes and organization change (#​112)

    🔗 Dependency Updates

    • Update paambaati/codeclimate-action action to v3.2.0 (#​93)
    • Update docker.io/library/postgres Docker tag to v15 (#​94)
    • Update module github.com/prometheus/client_golang to v1.14.0 (#​98)
    • Update module github.com/stretchr/testify to v1.8.1 (#​96)
    • Update module github.com/urfave/cli/v2 to v2.23.5 (#​95)
    • Update module github.com/prometheus/common to v0.39.0 (#​107)
    • Update goreleaser/goreleaser-action action to v4 (#​108)
    • Update docker.io/library/alpine Docker tag to v3.17 (#​100)
    • Update module github.com/urfave/cli/v2 to v2.23.7 (#​106)
    • Update module go.uber.org/zap to v1.24.0 (#​102)
    • Update module github.com/jackc/pgtype to v1.13.0 (#​103)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

  • Update goreleaser/goreleaser-action action to v4

    Update goreleaser/goreleaser-action action to v4

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | goreleaser/goreleaser-action | action | major | v3 -> v4 |


    Release Notes

    goreleaser/goreleaser-action

    v4

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

  • Update module github.com/urfave/cli/v2 to v2.23.7

    Update module github.com/urfave/cli/v2 to v2.23.7

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/urfave/cli/v2 | require | patch | v2.23.6 -> v2.23.7 |


    Release Notes

    urfave/cli

    v2.23.7

    Compare Source

    What's Changed

    Full Changelog: https://github.com/urfave/cli/compare/v2.23.6...v2.24.0


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

A cloud native distributed streaming network telemetry.
A cloud native distributed streaming network telemetry.

Panoptes Streaming Panoptes Streaming is a cloud native distributed streaming network telemetry. It can be installed as a single binary or clustered n

Sep 27, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

Jan 4, 2023
The Cloud Native Application Proxy
The Cloud Native Application Proxy

Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your ex

Dec 30, 2022
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io

中文 MOSN is a network proxy written in Golang. It can be used as a cloud-native network data plane, providing services with the following proxy functio

Dec 30, 2022
Cloud Native Tunnel
Cloud Native Tunnel

inlets is a Cloud Native Tunnel written in Go Expose your local endpoints to the Internet or within a remote network, without touching firewalls. Foll

Jan 4, 2022
Centralized Configuration System written in Golang - Spring cloud compatible
Centralized Configuration System written in Golang - Spring cloud compatible

Centralized Configuration System What is Vecosy Vecosy is a configuration service exposed through REST/GRPC. Is Spring Cloud Conf compatible and also

Dec 13, 2022
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.

gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era. Current status: Maintenance mode, accepting PRs. Currently in

Dec 25, 2022
Example of how to write reverse proxy in Go that runs on Cloud Run with Tailscale

Cloudrun Tailscale Reverse Proxy Setup Create a ephemeral key in Tailscale Set TAILSCALE_AUTHKEY in your Cloud Run environment variables Set TARGET_UR

Dec 18, 2022
☁️ Cloud Torrent: a self-hosted remote torrent client
☁️ Cloud Torrent: a self-hosted remote torrent client

Cloud torrent is a a self-hosted remote torrent client, written in Go (golang). You start torrents remotely, which are downloaded as sets of files on

Jan 6, 2023
hazelcast go-client interaction with hazelcast cloud

sample-application hazelcast go-client interaction with hazelcast cloud smart-client-deployment https://guides.hazelcast.org/kubernetes-external-clien

Nov 23, 2022
A wrapper for exposing a shared endpoint for Google Cloud Functions in go. API styled after Node.JS firebase-functions package.

firebase-fx A wrapper for Google Cloud Functions that simplifies the deployment of serverless applications. Meant to expose a similar API to the Fireb

Nov 7, 2022
This project provides fully automated one-click experience to create Cloud and Kubernetes environment to run Data Analytics workload like Apache Spark.
This project provides fully automated one-click experience to create Cloud and Kubernetes environment to run Data Analytics workload like Apache Spark.

Introduction This project provides a fully automated one-click tool to create Data Analytics platform in Cloud and Kubernetes environment: Single scri

Nov 25, 2022
Kodoo is a terminal UI for Odoo

Overview Terminal UI for Odoo The kodoo tool is a Terminal UI for Odoo that allow to show and query the data, it's destined for Odoo developers and fo

Apr 17, 2022
provide api for cloud service like aliyun, aws, google cloud, tencent cloud, huawei cloud and so on

cloud-fitter 云适配 Communicate with public and private clouds conveniently by a set of apis. 用一套接口,便捷地访问各类公有云和私有云 对接计划 内部筹备中,后续开放,有需求欢迎联系。 开发者社区 开发者社区文档

Dec 20, 2022
Carbon Black Harbor Adapter is a scanner to scan images in Harbor Registry with the help of Carbon Black Cloud.
Carbon Black Harbor Adapter is a scanner to scan images in Harbor Registry with the help of Carbon Black Cloud.

carbon-black-adapter-for-harbor Overview Carbon Black adapter for Harbor integrates your Harbor Registry with the Carbon Black Cloud. It leverages Har

Nov 1, 2022
stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a workload identity issued by another cloud provider.
stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a workload identity issued by another cloud provider.

stratus stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a w

Dec 26, 2021
Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers.

Cloud-Z Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers. Cloud type, instance id, and type CPU infor

Jun 8, 2022
Ent adapter for Casbin

Ent-Adapter Ent Adapter is the ent adapter for Casbin. With this library, Casbin can load policy from PostgresSQL/Mysql or save policy to it. Installa

Dec 20, 2022
Taos Adapter for TDengine

taosadapter Function Compatible with restful interface Compatible with influxdb v1 write interface Compatible with opentsdb json and telnet format wri

Jan 1, 2023
Go logger interface adapter

Glog glog is an abstraction for various Go language log libraries. The Logger interface is in maintenance-mode to prevent broken changes to projects b

Nov 17, 2021