Skip to content

aklefdal/break-styra-git-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Demo of bugs in Styra

This is a repo used to demonstrate bugs in Styra DAS Git integration

Create an initial state in your repo

  • root
    • rego
      • folder1
        • rules1.rego
      • folder2
        • rules2.rego

Create a Styra DAS system

  • Delete the files already there (rules.rego and test.rego)
  • Set it to read-only, as we do not intend to use the UI to edit rules, but instead let them flow from the source control system
  • Set up Git integration. You will need to create a Personal Access Token.

Test your system

  • Follow instructions in the 'install' tab of the settings.
  • Send POST to your local OPA to the url http://localhost:8181/data/folder1, you should receive a allow = false of some kind unless you specify the right input.
  • See branch "Working-1" in this repo.

Delete folder1

  • Commit, wait, and test the system again.
  • Folder1 gets deleted, so this bug is now fixed

Restructure folder2

Make it look like this:

  • root

    • rego
      • folder2
        • subfolder1
          • rules1.rego
        • subfolder2
          • rules2.rego
  • Adjust package names

  • Commit, wait, and test the system again.

💥 synced, but not looking good.

image

Fix

  • Delete what looks bad
  • image
  • Do a whitespace change to each file in the subfolder
  • Commit, push and wait
  • Looks good again:
  • image

More testing 1

  • Delete the files in folder2

  • Commit, but don't push yet

  • Re-add the files in a new folder structure:

  • root

    • rego
      • folder2
        • subfolder1
          • v1
            • rules1.rego
          • v2
            • rules2.rego
  • Commit, push and wait

💥 Explicit delete, then re-add does not help

image

More testing 2

  • Do restructuring of files
  • Commit, but don't push yet
  • Delete affected files in the UI
  • image
  • Push, and wait
  • This works! 🎉 Of course not a proper work-around for a production system.

About

This is a repo used to demonstrate bugs in Styra DAS Git integration

Resources

Stars

Watchers

Forks

Packages

No packages published