FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Verified Commit 8f115794 authored by Sebastiaan ten Pas's avatar Sebastiaan ten Pas
Browse files

feat: add proto files

parent 196033c9
No related branches found
No related tags found
1 merge request!1Add proto files
Checking pipeline status
root=true
[*.{yml,yaml}]
indent_style=space
indent_size=2
[*.md]
indent_style=space
indent_size=2
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# mypy
.mypy_cache/
# buf
gen
include:
- project: "uis/devops/continuous-delivery/ci-templates"
file: "/auto-devops/common-pipeline.yml"
ref: v6.7.2
variables:
BUILD_DISABLED: "1"
PYTHON_BUILD_DIST_DISABLED: "1"
CONTAINER_SCANNING_DISABLED: "1"
DAST_DISABLED: "1"
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# TODO: Remove this once
# https://gitlab.developers.cam.ac.uk/uis/devops/continuous-delivery/ci-templates/-/issues/57
# is addressed.
exclude: ^(CHANGELOG\.md|\.copier-answers\.yml)$
- id: check-yaml
args:
- --unsafe
- id: check-json
- id: check-toml
- id: check-xml
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: mixed-line-ending
- id: pretty-format-json
args:
- --autofix
- --no-sort-keys
- id: debug-statements
- repo: https://github.com/bufbuild/buf
rev: v1.50.1
hooks:
- id: buf-lint
- id: buf-format
{
"git": {
"commitMessage": "chore(release): ${version}"
},
"gitlab": {
"release": true,
"releaseName": "${version}"
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"header": "# Changelog",
"preset": {
"name": "conventionalcommits"
}
},
"@release-it/bumper": {
"out": {
"file": "pyproject.toml",
"type": "text/toml",
"path": "tool.poetry.version"
}
}
}
}
# Message schemas
This repository contains the message schemas for events published and consumed by the account
selector and account data manager.
## Generate code
Generation of code is done with `buf`. Look for installation instructions here:
https://github.com/bufbuild/buf
Once installed, simply run:
```
buf generate --template buf.gen.yaml
```
Or use `poe`:
```
poe generate
```
version: v2
managed:
enabled: true
plugins:
- remote: buf.build/community/danielgtaylor-betterproto:v1.2.5
out: "gen/python"
# Generated by buf. DO NOT EDIT.
version: v2
version: v2
modules:
- path: proto
lint:
use:
- STANDARD
breaking:
use:
- FILE
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
package = []
[metadata]
lock-version = "2.0"
python-versions = "*"
content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8"
syntax = "proto3";
package account_selector.v1;
message DateOfBirth {
message Date {
uint32 year = 1;
uint32 month = 2;
uint32 day = 3;
}
Date date = 1;
string source = 2;
}
message Code {
string code = 1;
string source = 2;
}
enum AccountEligible {
ACCOUNT_ELIGIBLE_UNSPECIFIED = 0;
ACCOUNT_ELIGIBLE_ELIGIBLE = 1;
ACCOUNT_ELIGIBLE_INELIGIBLE = 2;
ACCOUNT_ELIGIBLE_UNKNOWN = 3;
}
message Account {
string crsid = 1;
string name = 2;
string affiliation = 3;
string college = 4;
repeated DateOfBirth date_of_birth = 5;
repeated Code code = 6;
AccountEligible eligible = 7;
}
syntax = "proto3";
package account_selector.v1;
import "account_selector/v1/data.proto";
import "google/protobuf/timestamp.proto";
enum Operation {
OPERATION_UNSPECIFIED = 0;
OPERATION_CREATE = 1;
OPERATION_UPDATE = 2;
OPERATION_DELETE = 3;
}
message AccountSelectorEvent {
Operation operation = 1;
string crsid = 2;
account_selector.v1.Account account = 3;
google.protobuf.Timestamp valid_at = 4;
}
[tool.poetry]
name = "message-schemas"
version = "0.1.0"
description = ""
authors = [ ]
readme = "README.md"
package-mode = false
[tool.poe.tasks.generate]
help = "Generate code with protoc plugins"
cmd = "buf generate --template buf.gen.yaml"
[tool.poe.tasks.fix]
help = "Run pre-commit checks to fix formatting errors"
cmd = "pre-commit run --all-files"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment