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

Do packet-level verfication #39

Open
4 of 5 tasks
jkomoros opened this issue Jul 5, 2023 · 0 comments
Open
4 of 5 tasks

Do packet-level verfication #39

jkomoros opened this issue Jul 5, 2023 · 0 comments

Comments

@jkomoros
Copy link
Owner

jkomoros commented Jul 5, 2023

Type checking helps find a number of errors in seed packet definition at parse time. But there are other possible errors that it would be good to catch earlier.

For example, SeedReference to an invalid seed in the same packet. In the future there will likely be other problems (and possibly other warnings, a lint). Once there is a verifyPacket() for an unrolled packet, I'm sure we'll figure out other things to verify.

Once this is done, a convention for let/var is to have a named seed that wraps it:

{
  "get-user-name": {
    "type": "var",
    "name": {
      "id": "get-user-name-name"
    }
  },
  "get-user-name-name": {
    "type": "noop",
    "value": "user-name"
  }
}

That way you can fail at packet parse if you have the wrong variable name.

If you want this to be internal, make sure it's marked private:true. But if it's private:false then it's able to be used by other seed packets.

Originally tracked in #36.

  • Verify that every in-packet reference in a packet points to a seedID that exists.
  • Warn if there is a let on a private seed that has only one associated var, which is an unnecessary let. Return an error (not thrown) from vverifySeedPacket. (don't throw it if threre's an out-of-packet seed reference that we haven't loaded)
  • A noop seed type (like log but just literally returns value.
  • Warn if a namespace is not set
  • The CLI should print out warnings if --warn is set
jkomoros added a commit that referenced this issue Jul 6, 2023
…iven ExpandedSeedData.

This will be useful for validation.

Part of #39.
jkomoros added a commit that referenced this issue Jul 6, 2023
… is to a valid seed.

Not yet exercised.

Part of #39.
jkomoros added a commit that referenced this issue Jul 6, 2023
This catches instances where seeds have a local seed reference that is incorrect.

Part of #39.
jkomoros added a commit that referenced this issue Jul 6, 2023
Like `log`, but without logging.

Part of #39.
jkomoros added a commit that referenced this issue Jul 8, 2023
… to return warnings for things that might be problems.

Part of #39.
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 8, 2023
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

No branches or pull requests

1 participant