Repository navigation
Add migrations to ModuleDef - #5953
coolreader18 wants to merge 3 commits into
Conversation
202b400 to
eeda389
Compare
eeda389 to
04a4569
Compare
04a4569 to
612bd1b
Compare
612bd1b to
f90ea6a
Compare
| /// `AlgebraicTypeRef`s in other sections refer to this typespace. | ||
| /// See [`crate::db::raw_def::v9::RawModuleDefV9::typespace`] for validation requirements. | ||
| Typespace(Typespace), | ||
| macro_rules! with_v10_sections { |
There was a problem hiding this comment.
Why are we introducing a new macro here?
cloutiertyler
left a comment
There was a problem hiding this comment.
What's with all the macro work as part of this PR. It doesn't seem relevant and makes the code considerably more difficult to read.
f90ea6a to
a7238fe
Compare
a7238fe to
015a1a8
Compare
015a1a8 to
044877d
Compare
|
The first commit is to simplify the way we modify ModuleDefs - instead of doing a linear search for each one, and having all the different |
044877d to
b2d976d
Compare
|
It also means we're less likely to accidentally forget about a section, since we can exhaustively destructure the |
26dff90 to
b93ecac
Compare
joshua-spacetime
left a comment
There was a problem hiding this comment.
Can you add a module def round trip test for a migration:
RawModuleDefV10 → validate → ModuleDef → RawModuleDefV10 → validate
joshua-spacetime
left a comment
There was a problem hiding this comment.
Can you generate the module defs for the other languages?
| impl<T> SectionPayload for Vec<T> { | ||
| fn skip_serializing(&self) -> bool { | ||
| self.is_empty() |
There was a problem hiding this comment.
Is this correct to do for empty environments? It's unclear based on this comment:
/// `None` means undeclared; an explicitly empty declaration is `Some(empty)`.
Description of Changes
Adds migrations as a section of ModuleDef. The first commit adds a struct that contains all of the sections, so we don't have to do a linear search each time we modify one.
Rollback safety impact
n/a
Expected complexity level and risk
2
Testing
Stack created with GitHub Stacks CLI • Give Feedback 💬