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

feat(256): Implement Collection Environments in Backend #257

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

SoulKa
Copy link
Collaborator

@SoulKa SoulKa commented Feb 8, 2025

Changes

  • Add environments property to Collection and CollectionInfoFile, each having a variables property
  • Remove key property from VariableObject since the key is already held in a map. This aligns the InfoFile type with the respective TrufosObject thus simplifying mapping
  • Implement persistence layer version v1.1.0
  • Refactor persistence loading by moving InfoFile to TrufosObject mapping out of the PersistenceService into the info-file directory where the reverse mapping is currently implemented. This makes the service smaller and consolidates the mapping code in a single file
  • Always keep id, title, and version on top in the persisted TrufosObjects

Testing

Automated tests added. New persisted JSON looks like this:

{
  "id": "e49e452b-e0a9-484f-b15b-feb3eb614157",
  "title": "Default Collection",
  "version": "1.1.0",
  "variables": {
    "variable1": {
      "value": "test",
      "description": "Dunno, just testing"
    },
    "numbers": {
      "value": "1234321",
      "description": "Som other var"
    }
  },
  "environments": {
    "development": {
      "variables": {
        "baseUrl": {
          "value": "https://dev.test.com"
        }
      }
    },
    "staging": {
      "variables": {
        "baseUrl": {
          "value": "https://staging.test.com"
        }
      }
    },
    "production": {
      "variables": {
        "baseUrl": {
          "value": "https://test.com"
        }
      }
    }
  }
}

Checklist

  • Issue has been linked to this PR
  • Code has been reviewed by person creating the PR
  • Automated tests have been written, if possible
  • Manual testing has been performed
  • Documentation has been updated, if necessary
  • Changes have been reviewed by second person

@SoulKa SoulKa added enhancement New feature or request backend Backend related task labels Feb 8, 2025
@SoulKa SoulKa added this to the v0.2 milestone Feb 8, 2025
@SoulKa SoulKa self-assigned this Feb 8, 2025
@SoulKa SoulKa linked an issue Feb 8, 2025 that may be closed by this pull request
@SoulKa SoulKa force-pushed the feature/256-implement-environment-variables-in-backend branch from 694bcc8 to b63765a Compare February 9, 2025 11:53
@SoulKa SoulKa marked this pull request as ready for review February 9, 2025 11:58
@SoulKa SoulKa marked this pull request as draft February 9, 2025 12:00
@SoulKa SoulKa marked this pull request as ready for review February 9, 2025 16:15
@SoulKa SoulKa changed the title feat(185): Implement Collection Environments in Backend feat(256): Implement Collection Environments in Backend Feb 9, 2025
@SoulKa SoulKa force-pushed the feature/256-implement-environment-variables-in-backend branch 2 times, most recently from cf8f01d to d43a2b4 Compare February 11, 2025 08:02
src/renderer/state/variableStore.ts Outdated Show resolved Hide resolved
src/renderer/state/variableStore.ts Show resolved Hide resolved
@SoulKa SoulKa requested a review from kwerber February 15, 2025 13:34
@SoulKa SoulKa force-pushed the feature/256-implement-environment-variables-in-backend branch 2 times, most recently from e69e629 to 4411d49 Compare February 17, 2025 20:29
@SoulKa SoulKa force-pushed the feature/256-implement-environment-variables-in-backend branch from 4411d49 to ccbce66 Compare February 17, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related task enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend: Implement Environment Variables
2 participants