Skip to content

⚙️ Temporarily disable batch_upload feature#7197

Merged
sjproctor merged 3 commits into5.0-flexiblefrom
i479-disable-batch-upload-feature
Sep 21, 2025
Merged

⚙️ Temporarily disable batch_upload feature#7197
sjproctor merged 3 commits into5.0-flexiblefrom
i479-disable-batch-upload-feature

Conversation

@sjproctor
Copy link
Contributor

@sjproctor sjproctor commented Sep 19, 2025

This change prevents admin users from enabling batch_upload in settings. This addresses the issue that batch uploads and Valkyrized works are incompatible. The current Batch Add uses a fake Active Fedora form with fixed terms that ignore the selected work type, causing Valkyrie validations to fail (especially on 6.2).

It was determined that fixing this issue is low-priority compared to general Bulkrax improvements. To ensure users are not enabling broken features, batch_upload is disabled until further decisions are made.

Ref:

Screenshot 2025-09-19 at 2 39 06 PM

@samvera/hyrax-code-reviewers

This commit prevents admin users from enabling batch_upload in settings.
This addresses the issue that batch uploads and Valkyrized works are
incompatible. The current Batch Add uses a fake Active Fedora form with
fixed terms that ignore the selected work type, causing Valkyrie
validations to fail (especially on 6.2).

It was determined that fixing this issue is low-priority compared to
general Bulkrax improvements. To ensure users are not enabling broken
features, batch_upload is disabled until further decisions are made.

Ref:
- notch8/palni_palci_knapsack#479
@sjproctor sjproctor added the notes-minor Release Notes: Non-breaking features label Sep 19, 2025
@github-actions
Copy link

github-actions bot commented Sep 19, 2025

Test Results

    13 files  +    12      13 suites  +12   2h 55m 21s ⏱️ + 2h 55m 21s
 6 883 tests + 5 114   6 572 ✅ + 4 803  311 💤 +311  0 ❌ ±0 
18 279 runs  +16 510  17 766 ✅ +15 997  513 💤 +513  0 ❌ ±0 

Results for commit 59edc8a. ± Comparison against base commit 1ed93ef.

♻️ This comment has been updated with latest results.

The longer explanation about the disabled feature and accompanying URL
causes a long line error in Rubocop. Ignoring the offense.

Ref:
- notch8/palni_palci_knapsack#479
@sjproctor sjproctor requested a review from Copilot September 20, 2025 01:29
Copy link

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

Temporarily disables the batch_upload feature to prevent admins from enabling a known-broken workflow with Valkyrized works. The change introduces a custom Flipflop strategy to force the feature off, updates the feature description with guidance toward Bulkrax, styles the feature row to appear disabled in the admin UI, and skips related feature specs.

  • Added DisableFeatureStrategy to always return disabled for batch_upload.
  • Updated feature configuration and description with HTML notice.
  • Skipped affected batch edit specs (though current skip usage is flawed).

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config/features.rb Adds disabling strategy and updates batch_upload description.
app/strategies/hyrax/strategies/disable_feature_strategy.rb Implements custom Flipflop strategy to force-disable batch_upload.
app/assets/stylesheets/hyrax/_hyrax.scss Imports new admin_features stylesheet.
app/assets/stylesheets/hyrax/_admin_features.scss Styles batch_upload feature row to appear disabled.
spec/features/batch_edit_spec.rb Skips tests dependent on disabled feature (implementation issue present).

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Batch uploads have been disabled since batch uploads and Valkyrized
works are incompatible. The current Batch Add uses a fake Active Fedora
form with fixed terms that ignore the selected work type, causing
Valkyrie validations to fail (especially on 6.2).

It was determined that fixing this issue is low-priority compared to
general Bulkrax improvements. This commit skips the batch_upload tests
until further decisions are made.

Ref:
- #7185
- notch8/palni_palci_knapsack#479
@sjproctor sjproctor force-pushed the i479-disable-batch-upload-feature branch from b0dd16f to 59edc8a Compare September 20, 2025 01:49
@sjproctor sjproctor requested a review from Copilot September 20, 2025 03:16
Copy link

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

feature :batch_upload,
default: false,
description: "This functionality has been deprecated. Please use the bulk importer feature (Bulkrax) to perform this function moving forward."
description: "<strong>NOTICE:</strong> This feature has been temporarily disabled. To add or upload works in bulk, please use the <a href='https://github.com/samvera/bulkrax/wiki' target='_blank'>Bulkrax importer</a>.".html_safe
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

Using .html_safe on a string containing HTML markup can introduce XSS vulnerabilities. Consider using a safer approach like Rails' content_tag helper or ensure the HTML is properly sanitized.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +10
def enabled?(feature)
# Set batch upload to disabled
return false if feature == :batch_upload
# Return nil to pass through to next strategy for other features
nil
end
end
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Hard-coding the feature name :batch_upload makes this strategy inflexible. Consider making it configurable by accepting a list of features to disable, or using a constant to avoid magic values.

Suggested change
def enabled?(feature)
# Set batch upload to disabled
return false if feature == :batch_upload
# Return nil to pass through to next strategy for other features
nil
end
end
DISABLED_FEATURES = [:batch_upload].freeze
def enabled?(feature)
# Disable features listed in DISABLED_FEATURES
return false if DISABLED_FEATURES.include?(feature)
# Return nil to pass through to next strategy for other features
nil
end

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

I do like this concept, but if the text is hardcoded, then it doesn't make a lot of sense to do this.

Comment on lines +1 to +2
// Modify the batch_upload feature flipper to be disabled
tr[data-feature="batch-upload"] {
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The CSS selector uses a hard-coded feature name 'batch-upload' that should match the feature key. Consider using a CSS class or data attribute that can be dynamically applied based on disabled features to make this more maintainable.

Suggested change
// Modify the batch_upload feature flipper to be disabled
tr[data-feature="batch-upload"] {
// Apply disabled styling to any feature row marked as disabled
tr.feature-disabled {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@laritakr laritakr left a comment

Choose a reason for hiding this comment

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

I don't see a strong reason to make it configurable/flexible at this point.

@sjproctor sjproctor merged commit b0475ea into 5.0-flexible Sep 21, 2025
17 checks passed
@sjproctor sjproctor deleted the i479-disable-batch-upload-feature branch September 21, 2025 17:50
@ShanaLMoore
Copy link
Contributor

@sjproctor Sorry if I'm missing it. Friendly reminder to make a PR against main with these changes and close this PR. 🙏🏿 thanks!

@sjproctor sjproctor restored the i479-disable-batch-upload-feature branch September 22, 2025 17:09
@sjproctor sjproctor deleted the i479-disable-batch-upload-feature branch September 22, 2025 17:50
@sjproctor sjproctor restored the i479-disable-batch-upload-feature branch September 22, 2025 18:20
@sjproctor sjproctor deleted the i479-disable-batch-upload-feature branch September 22, 2025 18:25
@sjproctor sjproctor restored the i479-disable-batch-upload-feature branch September 22, 2025 18:28
@sjproctor sjproctor deleted the i479-disable-batch-upload-feature branch September 22, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes-minor Release Notes: Non-breaking features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants