Skip to content

Add routeEnum with validation and enhance error handling in BaseService [Twitter Gem TeamCity Packagist MozillaObservatory HexPm Greasyfork]#11800

Draft
jNullj wants to merge 14 commits intobadges:masterfrom
jNullj:core/route-enum-refactor-p1
Draft

Add routeEnum with validation and enhance error handling in BaseService [Twitter Gem TeamCity Packagist MozillaObservatory HexPm Greasyfork]#11800
jNullj wants to merge 14 commits intobadges:masterfrom
jNullj:core/route-enum-refactor-p1

Conversation

@jNullj
Copy link
Copy Markdown
Member

@jNullj jNullj commented Apr 11, 2026

A step towards #11371 and express.js

some impotent points:

  1. We can't use enum in route anymore in future versions of dependencies, this is a refactor is part 1 to solve this
  2. i tried to get the most elegant and efficient solution at the cost of flexibility
  3. the code assumes and limits enum only the first param, i couldn't find any services with multiple enum params and non first param as enum, it also makes semse
  4. if any exception arise, we can always solve them at handle()
  5. i could make a multi param system but it would be more costly in run-time then a single include check in an array.
  6. this will require many follow up PR for all services...

@jNullj jNullj added the core Server, BaseService, GitHub auth, Shared helpers label Apr 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 11, 2026

Warnings
⚠️ This PR modified service code for gem but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for greasyfork but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for hexpm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for mozilla-observatory but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for packagist but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for teamcity but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for twitter but not its test code.
That's okay so long as it's refactoring existing code.
⚠️

Found badge URL that may not follow our standard route abbreviations in services/gem/gem-downloads.service.js.
Please ensure you've reviewed our conventions.

Messages
📖 ✨ Thanks for your contribution to Shields, @jNullj!
📖

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS against 93befa3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Server, BaseService, GitHub auth, Shared helpers

Development

Successfully merging this pull request may close these issues.

1 participant