Skip to content

[fix] bug reporter: avoid duplicate mic file in / and /config-mic-files#3417

Open
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:fix-bug-reporter-avoid-duplicate-mic-file-in-and-config-mic-files
Open

[fix] bug reporter: avoid duplicate mic file in / and /config-mic-files#3417
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:fix-bug-reporter-avoid-duplicate-mic-file-in-and-config-mic-files

Conversation

@pieleric
Copy link
Copy Markdown
Member

@pieleric pieleric commented Mar 24, 2026

/config-mic-files contains all the files in CONFIG_PATH folder, which most usually include the standard MODEL file. So storing them in different folder meant the file was duplicated.
=> Just save in the same sub-folder.

Copilot AI review requested due to automatic review settings March 24, 2026 14:09
@pieleric pieleric requested a review from tepals March 24, 2026 14:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes bugreporter archive contents so the microscope model file is not duplicated at the zip root and under config-mic-files/, aligning the archive layout with how CONFIGPATH is already collected.

Changes:

  • Store the explicitly selected MODEL/MODEL_SELECTOR output in the same config_model_files collection as CONFIGPATH-globbed microscope files.
  • Stop adding the selected model file to the archive root-level files list (so it only appears in the config-mic-files/ subfolder).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@pieleric has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d2688d0-6461-4050-907a-bec5a6c196b4

📥 Commits

Reviewing files that changed from the base of the PR and between d5a57b0 and 83730ff.

📒 Files selected for processing (1)
  • src/bugreporter/odemis_bugreporter.py
📝 Walkthrough

Walkthrough

The PR modifies the compress_files method in the bug reporter to change where explicitly selected model files are stored within the generated archive. Instead of placing the selected model file at the zip root alongside other files, the change reorganizes it to be collected into the config-mic-files/ subfolder along with other model and hardware configuration files (*.odm.yaml and *.tsv files) found under the configuration path.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing duplicate model files in the archive by consolidating storage location.
Description check ✅ Passed The description clearly explains the problem (duplicate mic files) and the solution (consolidate into one subfolder), directly relating to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bugreporter/odemis_bugreporter.py`:
- Around line 348-350: The ZIP creation flattens names with os.path.basename(f)
for entries under config-mic-files causing duplicate member names when different
sources share a basename; update the code that writes entries (where
config_model_files is iterated and os.path.basename(f) is used — also at the
other occurrences you noted) to generate unique member names instead of basename
alone: either preserve a safe relative path (e.g., sanitize and use a subpath
derived from the original path or include the parent dir), or append a unique
suffix (counter/UUID or short hash) to the basename so entries like
config-mic-files/<name> become unique; apply this change consistently for
config_model_files and MODEL_SELECTOR handling and ensure the zip writes use the
new unique member name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91d04d69-f4e3-48ba-92a1-724871b80983

📥 Commits

Reviewing files that changed from the base of the PR and between ae50a7a and d5a57b0.

📒 Files selected for processing (1)
  • src/bugreporter/odemis_bugreporter.py

/config-mic-files contains all the files in CONFIG_PATH folder, which
most usually include the standard MODEL file. So storing them in
different folder maint the file was duplicated.
=> Just save in the same sub-folder.
@pieleric pieleric force-pushed the fix-bug-reporter-avoid-duplicate-mic-file-in-and-config-mic-files branch from d5a57b0 to 83730ff Compare March 26, 2026 08:44
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