e2corporation commented on PR #3356:
URL:
https://github.com/apache/incubator-devlake/pull/3356#issuecomment-1273355941
@likyh Since we have Jenkins using a "Job" concept to represent project,
lets create `models/JenkinsJob.js` (modeled after `GithubProject` for example)
Something along the lines of...
```
class JenkinsJob {
constructor(data = {}) {
this.id = data?.id || null
this.key = data?.key || this.id || null
this.name = data?.name || null
this.value = data?.value || this.name || this.id || null
this.title = data?.title || this.name || this.id || null
this.shortTitle = data?.shortTitle || null
this.useApi = data?.useApi || true
this.variant = data?.variant || 'job'
}
get(property) {
return this[property]
}
set(property, value) {
this[property] = value
return this.property
}
getConfiguredEntityId() {
return this.name.toString() || this.id
}
}
export default JenkinsJob
```
After creating the model, search for `new GitHubProject` in the codebase and
follow the same pattern to wrap Job objects with the `new JenkinsJob` model.
The model could even be applied in one place at the `createListData` entry
point, but you can follow the existing pattern being used by the other models
for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]