Note that the UI work of renaming Project Services to Integrations is handled in #119429 (closed) so this issue is purely about renaming on the backend
Nick Nguyenchanged title from Rename project_services to integrations to Rename project_services to integrations in codebase
changed title from Rename project_services to integrations to Rename project_services to integrations in codebase
Related to this issue, we should not change the metric definitions because that will break the SiSense dashboards. A lot of metrics having _service_ as part of the name will be impacted by this change, see https://docs.gitlab.com/ee/development/usage_ping/dictionary.html.
One possible approach is to rename the SiSense dashboards before merging these changes. We should create an issue in the GitLab Data Team project to have some help about approaching this. Also relevant is the process to deprecate and remove a metric !59000 (merged) (linking the merge request until we have the docs page updated).
Arturo Herrerochanged the descriptionCompare with previous version
A first MR has been merged !60968 (merged) containing changes needed to keep the classes working as STI models. It has moved across Assembla, Asana and Bamboo integrations.
I've been able to save the integration successfully. I haven't yet QA'd the integrations against a real servce. I've asked in Slack about login details.
The old JiraService model has been renamed Integrations::Jira in !61743 (merged) and I've QA'd on staging, and it looks fine. No errors in staging Sentry.
@.luke I'll start working on this issue too if that's alright
But I wanted to check first if you have any unpushed MRs, it looks like after !62359 (merged) and !61957 (merged) the remaining files are:
Monitoring services:
monitoring_service.rb
mock_monitoring_service.rb
prometheus_service.rb
Slash commands services:
slash_commands_service.rb
slack_slash_commands_service.rb
mattermost_slash_commands_service.rb
Data fields models:
issue_tracker_data.rb
jira_tracker_data.rb
open_project_tracker_data.rb
app/models/project_services/data_fields.rb: rename to app/models/concerns/integrations/has_data_fields.rb?
app/models/concerns/services/data_fields.rb: rename to app/models/concerns/integrations/data_fields.rb?
Others:
pushover_service.rb
slack_mattermost/notifier.rb
ee/app/models/project_services:
github_service.rb
github_service/remote_project.rb
github_service/status_message.rb
github_service/status_notifier.rb
gitlab_slack_application_service.rb (not a ChatService for some reason )
I think I'll start with the data fields models as I've already worked with them a bit, let me know your current status and thoughts on the proposed rename above!
Thanks, @toupeira! Yay, looking forward to working alongside you.
Yes, those are the groups of integrations, and working on them in those groups you've defined looks great.
For the integration models, these are the steps I've been taken per model. It's fairly obvious, but having it written down makes the manual task a bit quicker:
Rename and move the model (FooService becomes Integrations::Foo)
Move the specs (feature and unit - update the unit's RSpec.describe block)
Remove from .rubocop_manual_todo.yml (and also search through .rubocop_todo.yml and even .rubocop.yml to see if the file was being excluded from other cops, and if those exclusions are autocorrectable, autocorrect it, otherwise leave it)
Search through codebase for <Integration-Name>:: collisions with other files and proactively change them to reference the constant on the root namespace - i.e., !62265 (comment 581548111) - I don't rely on our test suite to necessarily pick these problems up, so just go and change everything even if it's likely not a problem
Search through codebase for the old model name, and fix most things, except where used as a translation key, or where used in SQL (i.e., where(type: 'FooService')) and... yeah use your discretion .
When each MR is merged, we tend to get merge conflicts on other open MRs due to steps 3, 4, 6 and 7 (4 and 6 because I've been alphabetising as I go, which tends to cause conflicts). If we're aware of each others' MRs, we could resolve those conflicts for each other's in-flight MRs and notify the other to pull the changes when they wake up.
For the "base" integration classes, I've started to rename those according to #331181 (closed) also - just because we're touching the file anyway. But I've been leaving out the abstract_class part because I don't wish to introduce functional changes in these MRs.
I'm going to peel off the Monitoring services group today.
Update: This turned out to be more difficult than I hoped, because PrometheusService is used as a GraphQL GlobalID which will need to remain compatible for arguments when we rename the model. I've come up with a possible WIP around this that I'll look into more tomorrow.
app/models/project_services/data_fields.rb: rename to app/models/concerns/integrations/has_data_fields.rb?
app/models/concerns/services/data_fields.rb: rename to app/models/concerns/integrations/data_fields.rb?
I like Integrations::HasDataFields! Perhaps would the other concern be better named Integrations::DataField (unpluralised, as in, this is "data field" model)?
@.luke thanks so much for the pointers, that's very helpful!
Perhaps would the other concern be better named Integrations::DataField (unpluralised, as in, this is "data field" model)?
Hmm I think plural would make more sense since each record has multiple "fields" (columns).
But also in light of the other base models, I think I'll go with Integrations::BaseDataFields and will make it into a proper class rather than a concern, there's only three models that use it and this should be a small enough change to not cause any trouble.
@arturoherrero@deuley Just an update on this issue. The only remaining models to be renamed are the monitoring integrations. There's been a hurdle to overcome first, and I'm happy to say that I have something I'm just tidying up for review that will get us over that hurdle. I need to stage the hurdle-overcoming MR first, and then the monitoring integrations MR will merge after that. We're cutting it fine in terms of delivering all parts for %14.0. However, so long as the hurdle-overcoming MR is merged in %14.0 the remaining work will be negligible (like, a weight 0.5). I'll keep you both updated.
The final MR !62645 (merged) has been merged, so I'll put this into workflowverification. If we don't see any related errors after a couple of days then I'll close it. cc @toupeira