Skip to content

Extract NodeTagging concern from Node model#11864

Open
isaksmith wants to merge 2 commits into
publiclab:mainfrom
isaksmith:extract-node-tagging-concern
Open

Extract NodeTagging concern from Node model#11864
isaksmith wants to merge 2 commits into
publiclab:mainfrom
isaksmith:extract-node-tagging-concern

Conversation

@isaksmith

@isaksmith isaksmith commented Mar 2, 2026

Copy link
Copy Markdown

Move all tag-related instance methods from Node (1192 lines) into a dedicated NodeTagging concern (314 lines), reducing Node to 913 lines.

Extracted methods:

  • Tag querying: has_power_tag, power_tag, power_tags, power_tag_objects, has_tag, has_tag_without_aliasing, get_matching_tags_without_aliasing, normal_tags, location_tags, tags, node_tags, tagnames, tagnames_as_classes
  • Tag mutation: add_tag, add_barnstar, can_tag, tag_activity
  • Tag-based features: has_mailing_list?, mailing_list, barnstar, barnstars, responded_to, responses, response_count, decimals, delete_coord_attribute

This is a pure refactoring — no logic changes. All methods are included back into Node via 'include NodeTagging'.

Part of #956 (Deprecate Drupal legacy database structures/naming)

Fixes #0000

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

Move all tag-related instance methods from Node (1192 lines) into a
dedicated NodeTagging concern (314 lines), reducing Node to 913 lines.

Extracted methods:
- Tag querying: has_power_tag, power_tag, power_tags, power_tag_objects,
  has_tag, has_tag_without_aliasing, get_matching_tags_without_aliasing,
  normal_tags, location_tags, tags, node_tags, tagnames, tagnames_as_classes
- Tag mutation: add_tag, add_barnstar, can_tag, tag_activity
- Tag-based features: has_mailing_list?, mailing_list, barnstar, barnstars,
  responded_to, responses, response_count, decimals, delete_coord_attribute

This is a pure refactoring — no logic changes. All methods are included
back into Node via 'include NodeTagging'.

Part of publiclab#956 (Deprecate Drupal legacy database structures/naming)
@isaksmith

Copy link
Copy Markdown
Author

Based on the details of each failing check, the tests aren't failing because of our code changes, they're failing because the CI workflow uses deprecated GitHub Actions (actions/upload-artifact: v2 was sunset). This is a pre-existing issue that affects all PRs on the repo, not just ours.

- actions/checkout@v2 → @v4
- actions/upload-artifact@v2 → @v4
- nanasess/setup-chromedriver@v1.0.1 → @v2
- buildsville/add-remove-label@v1 → @v2.0.1
- Rename duplicate artifact name for upload-artifact@v4 compatibility
@isaksmith

Copy link
Copy Markdown
Author

The unit-tests actually passed — all 323 tests, 915 assertions, 0 failures, 0 errors, 0 skips.

The job failed because of a Codecov rate limit during the coverage upload step at the very end:

This is an infrastructure issue with the upstream repo's Codecov configuration (no upload token set), not related to our code changes. The Codecov gem raises a StandardError on upload failure, which causes the non-zero exit code.

This isn't something we can fix in our PR — the upstream maintainers would need to either add a CODECOV_TOKEN secret or make the upload non-blocking.

@isaksmith

Copy link
Copy Markdown
Author

If it is possible, I'd love to help refactor the existing CI and workflow separately so that we could get this community project up and rolling again, updating depreciated tools and workflows, but I'd need to be able to have maintainer permissions.

I have experience working as a software engineer in test engineering at an enterprise data storage company and am passionate about environmental health. I've been trying to get more involved in open source and I think this would be a great project to help maintain.

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