Skip to content

Refinement of Schema Files: Integrating Scenario-Specific Relationships and Attributes #838

@tolgaOzen

Description

@tolgaOzen

Description

To improve our schema file structure for testing various user, company, organization, and team scenarios, we propose an enhancement that allows for scenario-specific definitions of relationships and attributes, while retaining the global definitions. This approach aims to provide both flexibility and efficiency in our testing process.

Current Schema Structure

Our schema file currently includes global definitions for entities, relationships, attributes, and scenarios. For example:

schema: |-
    entity user {}
    entity role {
        relation assignee @user
    }
    // ... other entities and relations ...

relationships:
    - dashboard:project-progress#view@role:admin#assignee
    // ... other global relationships ...

attributes:
    // ... global attributes ...

scenarios:
    - name: "User Dashboard View Permissions"
      // ... scenario details ...
    // ... other scenarios ...

Proposed Enhancement

Retain Global Definitions: Keep the global definitions of relationships and attributes as they are for overarching applicability.
Introduce Scenario-Specific Definitions: Allow for defining relationships and attributes within individual scenarios for more specific and contextual testing.

Example of Proposed Structure

scenarios:
  - name: "User Dashboard View Permissions for project-progress"
    description: "Verifies if user:1 has view access to the 'project-progress' dashboard."
    relationships:
      - dashboard:project-progress#view@role:admin#assignee
      - dashboard:project-progress#view@role:member#assignee
      // ... scenario-specific relationships ...
    attributes:
      // ... scenario-specific attributes ...
    checks:
      - entity: dashboard:project-progress
        subject: user:1
        assertions:
          view: true
  // ... other scenarios ...

Goals

Dual Flexibility: Maintain the efficiency of global definitions while providing the flexibility of scenario-specific configurations.
Clarity and Specificity: Enhance clarity in complex scenarios by allowing specific relationship and attribute definitions.
Streamlined Testing: Facilitate more focused and accurate scenario testing.

Action Items

  • Assess the current schema file structure and identify areas for integration of scenario-specific definitions.
  • Develop a prototype schema incorporating these changes.
  • Test and validate the effectiveness of the new schema structure.
  • Update documentation to guide the use of both global and scenario-specific definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Q1 2024 – Jan-Mar

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions