Skip to content

Development - #4

Open
xsrust wants to merge 2515 commits into
xsrust:developmentfrom
DMPRoadmap:development
Open

xsrust wants to merge 2515 commits into
xsrust:developmentfrom
DMPRoadmap:development

Conversation

@xsrust

@xsrust xsrust commented May 4, 2020

Copy link
Copy Markdown
Owner

Fixes # .

Changes proposed in this PR:

benjaminfaure and others added 30 commits September 10, 2024 10:31
Fix Flaky Tests / Optimize Checking of `plan.title` Within `spec/features/plans/exports_spec.rb`
…ar_chart_broken

Fix for #3443 - bar chart click function broken in usage dashboard
…d-id-as-identifier

Fix for bug in Plan duplication results in original plan identifier b…
Considering that the removed line occurred immediately after  `plan_copy.identifier = plan_copy.id.to_s`, I believe this  was meant to be `plan_copy.save!`. However, rather than correcting the variable, I think the line can be removed completely (explanation below).

The earlier execution of `plan_copy.save!` (line 257) is necessary because we need to generate a pk for `plan_copy`. However, the `duplicate` action within PlansController appears to be the only thing calling Plan.deep_copy, and the action is performing its own save on the copied plan returned from deep_copy:

  def duplicate
    plan = Plan.find(params[:id])
    authorize plan
    @plan = Plan.deep_copy(plan)
    respond_to do |format|
      if @plan.save
       ...
Using << here replaces manual foreign key assignment as well as the explicit save call.
Address Some Bullet Warnings / Optimise Mean Request Times
Updated URL in config.x.application.api_documentation_urls property in
config/initializers/_dmproadmap.rb.
The V1 API Docs link in Edit profile > API access tab was broken.
This adds test coverage for a previously undetected Rails 7 breaking change
affecting nested attribute params structure in `hidden_field_tag`
This change addresses a breaking issue introduced by the Rails 7 upgrade, where the hidden_field_tag parameters for nested attributes were not being processed correctly. The parameter structure has been updated to match Rails 7's expected format, ensuring proper handling of nested associations.
`execute_script('arguments[0].click();', modal_close_button)` works locally, however, the modal seems to be failing to close when the test is run as a GitHub Action.
  -  Strangely `execute_script('arguments[0].click();', modal_close_button)` works as a GitHub Action when executed for the 'Modal search opens and closes and allows user to search, select and remove items' test within this same file.
Fix `hidden_field_tag` Nested Attributes Format For Rails 7 Upgrade and Add Test Coverage
`render_respond_to_format_with_error_message` is called both when rescuing from Pundit::NotAuthorizedError and ActiveRecord::RecordNotFound. The method works properly with .html format, but prior to this change, ActionController::UnknownFormat was thrown for .pdf format.
- This change modifies the regex to capture the full versions for Ruby and Bundler.
The following error was being encountered in https://github.com/DMPRoadmap/roadmap/actions/runs/13907418160/job/38913596385?pr=3487:

```
Run actions/setup-ruby@v1
------------------------
NOTE: This action is deprecated and is no longer maintained.
Please, migrate to https://github.com/ruby/setup-ruby, which is being actively maintained.
------------------------
Error: Version 3.0.4 not found
```
- This change provides a temporary workaround for the following GitHub Issue: #3485
- This commit should be reverted once our tests are able to run successfully with the latest version of Chrome.
briri and others added 10 commits August 4, 2026 15:39
Prior to this change, `config/database.yml` was configured such that running tests would be executed against the dev db. This would result in the dev db being destroyed after tests. This change ensures that the tests are executed against a separate test db and that the dev db persists while testing.
…e-config

Update `database.yml.sample`: add separate test db
- Function checks if resource owner is active and present before authorization, and returns error if not
- Move code assigning resource_owner to this new function for better readability
- Remove payload[:message], copying v1 behaviour
@xsrust xsrust added codex and removed codex labels Sep 9, 2026
aaronskiba and others added 18 commits September 9, 2026 11:16
Disables a rubocop offence to fix a failing GitHub Actions workflow.
Fixes issue with API token auth
Harden Pundit policies for contributor and research output endpoints to enforce the expected access controls.
Reference: CDLUC3#803
- NOTE: The referenced PR also fixes app/controllers/paginable/research_outputs_controller.rb. However, that file does not exist within this codebase.

Co-Authored-By: Juliet Shin <8452761+jupiter007@users.noreply.github.com>
Add specs for the contributors index and new endpoints to ensure unauthorized plans are denied access.
fix(policy): harden authorization for plan resources
* Upgrade Roadmap to Ruby 3.4 and Rails 8.1

* Address Rails 8 upgrade review findings

* Document Rails 8 release and refresh schema annotations

* Use pinned Chrome binary for feature specs in CI

* Update GitHub Actions to Node 24 runtimes

---------

Co-authored-by: Alasdair Macleod <alasdair.j.macleod@ed.ac.uk>
Update user administration checks and record validation, with regression coverage and compatibility fixes. Detailed advisories will be published after release.
Add request coverage for super admins changing a user's organization and department in the same update. This exposes a validation-order issue where the department is checked against the user's current organization.
Super-admin user updates saved the permitted attributes first, then applied the selected organization in a separate `@user.update(org_id: ...)` call.

With department membership now validated against the user's organization, a request that changed the organization and department together was rejected: the department was checked against the user's current organization, and the organization change was never applied.

Assign `org_id` from the organization lookup before updating, so a single `@user.update` validates the organization and department together. The follow-up update call is removed.

Reload `@departments` after the update. It was previously built before the update, so after an organization change the re-rendered form listed the previous organization's departments. After a failed update, `@user.org` holds the unsaved organization, so the dropdown now matches the form's selected organization.
Add a TODO to verify whether the new-organization save block is still needed.

When org creation is allowed, org_from_params saves new organizations and identifiers before returning. When org creation is restricted, it returns an existing organization or nil. In either case, the controller's new-record fallback appears unreachable.
Refresh department options after successful and failed edits, preserve stored attributes on validation errors, and return HTTP 422 for invalid updates. Remove duplicate organization persistence now that selection-service coverage verifies organization and identifier creation.
fix(super_admin): update user org and department in a single save
Prepare v6.0.1 maintenance release
Merging merge conflicts as-is for auditing purposes. Will resolve merge conflicts in next commit.
For auditing purposes, commit 20df70e was merged without resolving its merge conflicts. This commit resolves those conflicts.

File resolutions:

CHANGELOG.md
- Accept both changes

db/schema.rb
- Use `ActiveRecord::Schema[8.1].define(version: 2026_02_19_185224) do`
  - This uses new Rails version as well as timestamp of latest migration
- Accept current changes to retain Doorkeeper tables

Gemfile.lock
- Accept incoming changes and run `bundle install`

All other files
- Accept incoming changes
chore: merge branch `main` into `development`
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.