Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDP-8328: Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() #1763

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

Tweedeldee
Copy link
Contributor

@Tweedeldee Tweedeldee commented Dec 6, 2024

Description

In deploy-board, Normandie and Knox statuses are to be added to hosts/host_details.html.
hosts/host_details.html is rendered in two places, using a list of hosts coming from two different methods

hosts = hosts_helper.get_hosts_by_name(request, hostname) :

return render(request, 'hosts/host_details.html', {

hosts = environ_hosts_helper.get_host_by_env_and_hostname(request, name, stage, hostname)

return render(request, 'hosts/host_details.html', {

This means that both get_hosts_by_name and get_host_by_env_and_hostname needs to return normandie and knox statuses.

This is done by:

  • creating a new POJO class, HostBeanWithStatuses, which inherits HostBean and include the two new fields
  • update the relevant DAO methods to return HostBeanWithStatuses
  • update the associated SQL queries to retrieve the two fields from hosts_and_agents table

Associated PRs

@github-actions github-actions bot added the deploy-service Includes changes to deploy-service label Dec 6, 2024
@Tweedeldee Tweedeldee force-pushed the jpierre/CDP-8328-hostbean branch 2 times, most recently from b0a1a19 to b949724 Compare December 9, 2024 22:42
@Tweedeldee Tweedeldee marked this pull request as ready for review December 9, 2024 22:43
@Tweedeldee Tweedeldee requested a review from a team as a code owner December 9, 2024 22:43
@@ -153,9 +89,4 @@ public SetClause genSetClause() {
+ "last_update=VALUES(last_update),"
+ "state=VALUES(state),"
+ "can_retire=VALUES(can_retire)";

@Override
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, this toString() might be used for non-trivial logic, and it's quite hard to identify all toString() usages since the method can be implicitly called.
Reverting the change to keep the existing behavior.

@Tweedeldee Tweedeldee force-pushed the jpierre/CDP-8328-hostbean branch from b949724 to b0f6c6a Compare December 10, 2024 00:25
Base automatically changed from jpierre/CDP-8328-split-deploy-service to master December 10, 2024 18:31
@Tweedeldee Tweedeldee force-pushed the jpierre/CDP-8328-hostbean branch from e747f13 to af17461 Compare December 10, 2024 19:11
@Tweedeldee Tweedeldee force-pushed the jpierre/CDP-8328-hostbean branch from af17461 to 6c0c1bb Compare December 10, 2024 19:13
@Tweedeldee Tweedeldee changed the title CDP-8328: Add normandie status and knox statuses to HostBean and hostDAO.getHosts CDP-8328: Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() Dec 10, 2024
@Tweedeldee Tweedeldee changed the title CDP-8328: Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() CDP-8328: deploy-service reads : Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() Dec 10, 2024
@Tweedeldee Tweedeldee changed the title CDP-8328: deploy-service reads : Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() CDP-8328: Add normandie status and knox statuses to Hosts.get() EnvHosts.getHostByHostName() Dec 10, 2024
@Tweedeldee Tweedeldee merged commit 288938b into master Dec 11, 2024
6 checks passed
@Tweedeldee Tweedeldee deleted the jpierre/CDP-8328-hostbean branch December 11, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-service Includes changes to deploy-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants