Made changes to fix the head sha commit in diff comment#56
Conversation
1- Made changes to GithubActionsSettings to now lookup the pr number 2- Renamed head commit sha var names to align 3- Modified the diff comment to indicate head sha commit Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
diff_poetry_lock/settings.py
Outdated
| def set_pr_lookup_service(self, service: PrLookupService) -> None: | ||
| object.__setattr__(self, "_pr_lookup_service", service) |
There was a problem hiding this comment.
question: Why can't this be self._pr_lookup_service = service?
There was a problem hiding this comment.
Updated to how it was before; had to define it as private attribute in vela and github actions settings
| logger.warning("PR lookup requested before service configured; returning None") | ||
| return None |
There was a problem hiding this comment.
issue (non-blocking): Can the rest of the process continue if the pr_num isn't available? If it can, this is fine. If it can't, then this should raise an exception.
There was a problem hiding this comment.
Yes. Wherever pr_num is called, we've a check to see whether it is None because it's not a blocker
| logger.debug("VelaSettings event_name={}", self.event_name) | ||
|
|
||
| def set_pr_lookup_service(self, service: PrLookupService) -> None: | ||
| self._pr_lookup_service = service |
There was a problem hiding this comment.
thought: ☝️ like this was
There was a problem hiding this comment.
Updated to set it like how it did before
| sigil_envvar: ClassVar[str] | ||
| """The envvar in this will always be present when this settings is valid.""" | ||
|
|
||
| _pr_lookup_service: PrLookupService | None = None |
There was a problem hiding this comment.
note: Ah, I see, this was promoted to the base class from VelaSettings…
1- Updated the handling of _pr_lookup_service; defined it and _pr_num_cached as private attributes in both vela and github actions settings Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
1- Made changes to GithubActionsSettings to now lookup the pr number
2- Renamed head commit sha var names to align
3- Modified the diff comment to indicate head sha commit
This fixes #55