Skip to content
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

updates to allow for testing services with notifications #371

Merged

Conversation

tonytheleg
Copy link
Contributor

PR Template:

Describe your changes

  • Adds an alternate SpiceDB compose setup that uses a different postgres since everything wants to use the default port
  • Adds related make target for spinning that up
  • Adds doc on running notifications + inventory + relations locally using binaries and compose

Ticket reference (if applicable)

Fixes #

Checklist

  • Are the agreed upon acceptance criteria fulfilled?

  • Was the 4-eye-principle applied? (async PR review, pairing, ensembling)

  • Do your changes have passing automated tests and sufficient observability?

  • Are the work steps you introduced repeatable by others, either through automation or documentation?

    • If automation is possible but not done due to other constraints, a ticket to the tech debt sprint is added
    • An SOP (Standard Operating Procedure) was created
  • The Changes were automatically built, tested, and - if needed, behind a feature flag - deployed to our production environment. (Please check this when the new deployment is done and you could verify it.)

  • Are the agreed upon coding/architectural practices applied?

  • Are security needs fullfilled? (e.g. no internal URL)

  • Is the corresponding Ticket in the right state? (should be on "review" now, put to done when this change made it to production)

  • For changes to the public API / code dependencies: Was the whole team (or a sufficient amount of ppl) able to review?

```

### Running Inventory:
The process to run Inventory locally can be found in Inventory API's [README](https://github.com/project-kessel/inventory-api?tab=readme-ov-file#kessel-inventory--kessel-relations-using-built-binaries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the steps in this link bring up a db to work with gorm? make migrate makes me think of an in-memory db maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the config is setup to use sqllite by default. The make migrate will call the migrate command which leverages gorm to setup the db.

The config can be manualy changed for postgres if needed and such, but sqllite should be sufficient enough or testing gorm changes i would suspect

$ make migrate 
mkdir -p bin/ && /usr/bin/go build -ldflags "-X cmd.Version=6871f97" -o ./bin/ ./...
./bin/inventory-api migrate --config .inventory-api.yaml
INFO msg=Using config file: .inventory-api.yaml
Log Level is set to: info
Log Level is set to: info
INFO ts=2025-02-12T10:46:02-05:00 caller=log/log.go:30 service.name=inventory-api service.version=0.1.0 trace.id= span.id= group=storage msg=Persistence disabled: false
INFO ts=2025-02-12T10:46:02-05:00 caller=log/log.go:30 service.name=inventory-api service.version=0.1.0 trace.id= span.id= group=storage msg=Using backing storage: sqlite3
INFO ts=2025-02-12T10:46:02-05:00 caller=log/log.go:30 service.name=inventory-api service.version=0.1.0 trace.id= span.id= group=storage msg=Migration successful!

$ sqlite3 inventory.db 
SQLite version 3.46.1 2024-08-13 09:16:08
Enter ".help" for usage hints.
sqlite> .tables
local_inventory_to_resources  resource_history            
relationship_history          resources                   
relationships               

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tonytheleg tonytheleg force-pushed the local-testing-w-notifications branch from 8387bb7 to a4737a3 Compare February 12, 2025 18:32
@tonytheleg tonytheleg force-pushed the local-testing-w-notifications branch from a4737a3 to d038684 Compare February 12, 2025 18:33
@tonytheleg tonytheleg merged commit 43ab93a into project-kessel:main Feb 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants