-
Notifications
You must be signed in to change notification settings - Fork 5
Rerender single functionality #216
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
base: main
Are you sure you want to change the base?
Changes from all commits
0f1bcb9
c62dec3
9348243
6958e45
fdf271a
ffa32e7
9b282b3
4e017c7
dbd7f26
f67a36d
a3d6131
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,3 +30,5 @@ dist | |
|
|
||
| .coverage | ||
| logging_config.yaml | ||
|
|
||
| .claude/worktrees/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,23 @@ def load_module_metadata(self) -> dict | None: | |
| with open(metadata_path, "r", encoding="utf-8") as f: | ||
| return json.load(f) | ||
|
|
||
| def update_frid_in_module_metadata(self, frid: str, frid_text: str, update_source_hash: bool = False) -> None: | ||
| metadata = self.load_module_metadata() or {} | ||
| functionalities = metadata.get(MODULE_FUNCTIONALITIES, []) | ||
| frid_index = int(frid) - 1 | ||
| if frid_index < len(functionalities): | ||
| functionalities[frid_index] = frid_text | ||
| else: | ||
| functionalities.append(frid_text) | ||
| metadata[MODULE_FUNCTIONALITIES] = functionalities | ||
| if update_source_hash: | ||
| metadata["source_hash"] = self.get_module_source_hash() | ||
|
|
||
| codeplain_folder = self.get_codeplain_folder() | ||
| os.makedirs(codeplain_folder, exist_ok=True) | ||
| with open(self.module_metadata_path(), "w", encoding="utf-8") as f: | ||
| json.dump(metadata, f, indent=4) | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This causes the JSON's content to be out of order but I don't think that's important because JSON by standards doesn't need to have ordered keys. e.g.: if you render a project with FRs 1, 2, 3 and then rerender 2, you would get the content of the module_metadata.json file as: |
||
| def get_module_source_hash(self) -> str: | ||
| return plain_spec.get_hash_value([self.plain_source] + self.resources_list) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change: was wokring in a worktree and this directory kept popping up in the changes and I think we should ignore it if you're using worktrees.