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

feat: Jobs now shown in a table in the main page #3784

Merged

Conversation

marcosdiez
Copy link
Contributor

@marcosdiez marcosdiez commented Sep 20, 2023

what

I wanted to see all the jobs running in/executed by atlantis in a single page.

why

This will help me see all my plans at once. They are sorted by age, which also helps. Will also help me to fix #3767 in the future.

Since the data is obtained from memory, it will be cleared when atlantis is restarted and therefore it should not show any dead links.

It may be a nice workaround for #3783

screenshot

image

and when there are no jobs,

image

The PR can be quickly tested using the following docker container: marcosdiez/atlantis:v0.25.0b

@marcosdiez marcosdiez requested a review from a team as a code owner September 20, 2023 04:47
@github-actions github-actions bot added the go Pull requests that update Go code label Sep 20, 2023
@marcosdiez marcosdiez changed the title Jobs now shown in a table in the main page feat: Jobs now shown in a table in the main page Sep 20, 2023
@jamengual jamengual added waiting-on-review Waiting for a review from a maintainer feature New functionality/enhancement ui labels Sep 20, 2023
@X-Guardian
Copy link
Contributor

Hi @marcosdiez, this would be a great addition to Atlantis.

I've run some tests using your branch and there are a few issues:

  1. When a PR is merged or closed, the jobs belonging to the PR are not removed from the list.
  2. The order of the jobs displayed is not consistent. I would suggest sorting them by repository, project, workspace then date.
  3. The repository name, project and workspace don't always populate in the table.

I would also suggest displaying the list of jobs on a separate tab, rather than below the list of lock files. This could be achieved easily using something like this example: https://www.w3schools.com/howto/howto_js_tabs.asp

You also need to update the tests for the Go files you are changing.

@marcosdiez
Copy link
Contributor Author

Hi @X-Guardian !

Thanks for reviewing.

About the order not being consistent, I could easily fix that. The biggest fix I actually need to do is that the row lines are not showing. I'll try to work on that as well.

Now why would I stop showing the logs of a merged PR ? If we have the data, I want it to be seen. The primary reason I wrote this code was because I was being affected by #3767 . So more data is better than less data. Maybe I could add a new column showing the PR status (opened/closed/merged) or something like that. I don't recall if we have that data in memory.

Also, I can't reproduce "The repository name, project and workspace don't always populate in the table.". We've been using it in an environment with more than 50 people (on GitHub) and this is not happening.

I don't mind implementing the tabs either nor unit tests.

That being said, I want to fix everything in one sit, so we need to agree on 1) and I need to know how to reproduce 3)
(or we agree we can survive without them)

Thanks

Marcos

@X-Guardian
Copy link
Contributor

Hi Marcos. I have been testing it on GitLab. Let me try it on GitHub and see if I get the same issue with the repo name/project workspace not showing.

Regarding keeping all the log references. Eventually you are going to have so many that the Atlantis server will surely run out of memory and fall over, so I don't think that is viable.

@X-Guardian
Copy link
Contributor

OK, the entries with no repository name, project or workspace are the outputs from pre/post workflow hooks.

@marcosdiez
Copy link
Contributor Author

@X-Guardian I don't keep logs in memory. I just list all the logs there currently are in memory. If you look at my code, the only modification that I did is that whenever a "log in memory" is created, I am also saving the timestamp so I can later use it to sort.

So I won't ever cause atlantis to run out of memory :)

@marcosdiez
Copy link
Contributor Author

Could you please show me a screenshot with pre/post workflow hooks so I can see what it looks like?

@X-Guardian
Copy link
Contributor

Here you go:

image

@GenPage GenPage added waiting-on-response Waiting for a response from the user quick-win Is obviously something Atlantis should do and will take <4 hrs work and removed waiting-on-review Waiting for a review from a maintainer labels Sep 25, 2023
@marcosdiez marcosdiez force-pushed the jobs_now_shown_in_a_table_in_the_main_page branch from fd32def to b3d4019 Compare September 26, 2023 09:15
@marcosdiez
Copy link
Contributor Author

Sorting implemented and we now show lines below each row.

I just have to implement the list of tabs and fix the unit tests

image

@marcosdiez marcosdiez force-pushed the jobs_now_shown_in_a_table_in_the_main_page branch from b3d4019 to da82500 Compare September 27, 2023 12:30
@marcosdiez
Copy link
Contributor Author

@X-Guardian all the tests pass now. I was thinking, I personally prefer two tables one below the other one. If you really want, I can implement the tabs, though.

@jamengual
Copy link
Contributor

as @X-Guardian said we need to review it too.
Thanks @X-Guardian for the feedback.
@GenPage is extremely busy with other PRs so is going to have to wait a bit.

@jamengual jamengual added the waiting-on-review Waiting for a review from a maintainer label Sep 27, 2023
@marcosdiez marcosdiez force-pushed the jobs_now_shown_in_a_table_in_the_main_page branch from da82500 to d0d39d9 Compare September 28, 2023 01:10
@jamengual jamengual removed the waiting-on-response Waiting for a response from the user label Oct 10, 2023
@jamengual
Copy link
Contributor

@marcosdiez can you fix the lint errors?

@marcosdiez marcosdiez force-pushed the jobs_now_shown_in_a_table_in_the_main_page branch from d76973c to 4995d91 Compare October 10, 2023 02:04
@marcosdiez
Copy link
Contributor Author

@jamengual done!

@jamengual
Copy link
Contributor

@marcosdiez can you please fix the conflicts? Thanks.

@jamengual jamengual removed the waiting-on-review Waiting for a review from a maintainer label Nov 15, 2023
@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Nov 15, 2023
@jamengual jamengual added this to the v0.26.0 milestone Nov 15, 2023
@marcosdiez marcosdiez force-pushed the jobs_now_shown_in_a_table_in_the_main_page branch from 4995d91 to 317c731 Compare November 15, 2023 11:53
@marcosdiez
Copy link
Contributor Author

@jamengual done!

@jamengual jamengual added waiting-on-review Waiting for a review from a maintainer and removed waiting-on-response Waiting for a response from the user labels Nov 16, 2023
@GenPage GenPage modified the milestones: v0.26.0, v0.27.0 Dec 11, 2023
@GenPage GenPage enabled auto-merge (squash) December 12, 2023 02:34
@GenPage GenPage merged commit ce95f8e into runatlantis:main Dec 12, 2023
24 checks passed
@X-Guardian
Copy link
Contributor

The pre and post workflow hooks outputs are still broken in this.

@nitrocode
Copy link
Member

Nice job with this PR. I do like seeing the exposed jobs.

The pre and post workflow hooks outputs are still broken in this.

Yep, I can confirm that the pre and post workflow jobs still show up as empty rows as indicated by @X-Guardian. I created the link issue above 4132. If you get a chance @marcosdiez, please look into it.

ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
* feat: better logging for UpdateStatus

* feat: jobs now shown in a table in the main page

---------

Co-authored-by: PePe Amengual <[email protected]>
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
* feat: better logging for UpdateStatus

* feat: jobs now shown in a table in the main page

---------

Co-authored-by: PePe Amengual <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement go Pull requests that update Go code quick-win Is obviously something Atlantis should do and will take <4 hrs work ui waiting-on-review Waiting for a review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On GitHub, sometimes Atlantis can't post the URL for Real Time Logs
5 participants