Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL = /bin/sh

VERSION=1.9.0
VERSION=1.10.0
BUILD=`git rev-parse HEAD`

LDFLAGS=-ldflags "-w -s \
Expand Down
2 changes: 0 additions & 2 deletions fakeserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

var testSchema = `
serializer_version: 1
schema_version: "2020011774023"
splits:
- name: test.test_experiment
weights:
Expand All @@ -35,7 +34,6 @@ splits:

var otherTestSchema = `{
"serializer_version": 1,
"schema_version": "2020011774023",
"splits": [
{
"name": "test.json_experiment",
Expand Down
16 changes: 1 addition & 15 deletions migrationmanagers/migrationmanagers.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,7 @@ func (m *MigrationManager) ApplyToSchema(migrationRepo migrations.Repository, id
return err
}

err = m.migration.ApplyToSchema(m.schema, migrationRepo, idempotently)
if err != nil {
return err
}

appliedVersion := m.migration.MigrationVersion()
if appliedVersion != nil && m.schema.SchemaVersion < *appliedVersion {
m.schema.SchemaVersion = *appliedVersion
}
return nil
return m.migration.ApplyToSchema(m.schema, migrationRepo, idempotently)
}

// Sync applies the contents of a migration to the TestTrack server
Expand Down Expand Up @@ -160,10 +151,5 @@ func (m *MigrationManager) SyncVersion() error {
return fmt.Errorf("got %d status code", resp.StatusCode)
}

appliedVersion := m.migration.MigrationVersion()
if m.schema.SchemaVersion < *appliedVersion {
m.schema.SchemaVersion = *appliedVersion
}

return nil
}
3 changes: 0 additions & 3 deletions schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ func applyAllMigrationsToSchema(schema *serializers.Schema) error {
return err
}
}
if len(versions) != 0 {
schema.SchemaVersion = versions[len(versions)-1]
}
return nil
}

Expand Down
7 changes: 3 additions & 4 deletions schemaloaders/schemaloaders.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ func (s *SchemaLoader) Load() error {
}
}

// The schema body is assumed to reflect every migration on disk (the CLI
// always writes them together), so mark them all applied - this is what
// lets a freshly bootstrapped server skip replaying history.
for _, version := range s.migrationRepo.SortedVersions() {
if version > s.schema.SchemaVersion {
fmt.Println("Schema load complete, but there are migrations newer than the schema file - run testtrack migrate to apply them.")
break
}
err := migrationmanagers.NewWithServer((*s.migrationRepo)[version], s.server).SyncVersion()
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion serializers/serializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ type SchemaSplit struct {
// migration validation and bootstrapping of new ecosystems
type Schema struct {
SerializerVersion int `yaml:"serializer_version" json:"serializer_version"`
SchemaVersion string `yaml:"schema_version" json:"schema_version"`
Splits []SchemaSplit `yaml:"splits,omitempty" json:"splits,omitempty"`
IdentifierTypes []IdentifierType `yaml:"identifier_types,omitempty" json:"identifier_types,omitempty"`
RemoteKills []RemoteKill `yaml:"remote_kills,omitempty" json:"remote_kills,omitempty"`
Expand Down
Loading