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

Remove volatility from schema manifest file #160

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

erichaagdev
Copy link
Contributor

The schema paths written to the schema manifest are full absolute paths. This introduces volatility in the build, makes it non-reproducible and non-relocatable, since the full absolute path to a schema will vary between machines, e.g., between a local user and a CI machine. An additional source of volatility is the timestamp written to the file which will vary between every invocation even on the same machine.

With this change, the schema paths written to the schema manifest are relativized to the base project directory. The relative path to a schema is all that's required locate it and will always be consistent between machines. Additionally, the java-ordered-properties library is used to ensure the properties file is always written in a deterministic order and removes the unnecessary timestamp.

The schema paths written to the schema manifest are full absolute paths.
This introduces volatility in the build, makes it non-reproducible and
non-relocatable, since the full absolute path to a schema will vary
between machines, e.g., between a local user and a CI machine. An
additional source of volatility is the timestamp written to the file
which will vary between every invocation even on the same machine.

With this change, the schema paths written to the schema manifest are
relativized to the base project directory. The relative path to a schema
is all that's required locate it and will always be consistent between
machines. Additionally, the java-ordered-properties library is used to
ensure the properties file is always written in a deterministic order
and removes the unnecessary timestamp.
@deweyjose
Copy link
Owner

Thanks for the contribution @erichaagdev! I'll take a look tonight and try to release in the coming days.

@chris-pirie
Copy link

Thanks so much for addressing this @erichaagdev! This is going to allow us to leverage build caching across over 500 of our repositories!! 😍

@erichaagdev
Copy link
Contributor Author

@deweyjose I pushed one additional change. It occurred to me the schema-manifest.props file shouldn't even be written to the target sources directory to begin with. This additional change gives the file its own directory.

@deweyjose deweyjose merged commit 2b33e4a into deweyjose:main Jul 9, 2024
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

Successfully merging this pull request may close these issues.

3 participants