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

write ordered and formatted project.json files #746

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

tareksha
Copy link
Contributor

What issues does this PR fix or reference?

The project meta-data file .che/project.json are written each time a project configuration is updated. This file is currently written in a compact form with no whitespaces or any defined order. This causes every project update to rewrite the only line in the JSON file, making it hard for version control to track the changes or merge them without reporting conflicts.

Previous Behavior

.che/poject.json is written in unordered compact form.

New Behavior

  • .che/poject.json is written in formatted form, separating fields and nested data properly.
  • The fields inside project.json maintain a stable order. They are written in the same order they were read in, placing new data in the end.
  • Use Gson for reading /writing project.json to benefit from its streaming-based JSON serialization.
  • Use UTF-8 consistently for reading/writing the contents of project.json instead of relying on the environment.

Signed-off-by: Tareq Sharafy [email protected]

reduce conflicts by keeping a consistent project.json file structure.
JSON fields are maintained in a stable order and the output JSON is
formatted

Signed-off-by: Tareq Sharafy <[email protected]>
Change-Id: Ic3a9cd74163c43cb288a16050a6f503178f4d2c8
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.

1 participant