Skip to content

Fixes #39253 - Implement "Not Found" error handling for invalid Job I…#1030

Open
pondrejk wants to merge 1 commit intotheforeman:masterfrom
pondrejk:invocations-empty-page
Open

Fixes #39253 - Implement "Not Found" error handling for invalid Job I…#1030
pondrejk wants to merge 1 commit intotheforeman:masterfrom
pondrejk:invocations-empty-page

Conversation

@pondrejk
Copy link
Copy Markdown
Contributor

…nvocation IDs

SAT-44544

image

@pondrejk pondrejk force-pushed the invocations-empty-page branch from 3cf4949 to 412d2fe Compare April 24, 2026 08:13
Copy link
Copy Markdown
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

Some nitpicks, seems to work well.

<EmptyStateBody>
{sprintf(
__(
'There is no job invocation with id %s or there are access permissions needed. Please contact your administrator if this issue continues.'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From the top of my head, I could envision four error cases that can happen:

  1. The user doesn't have permission to view job invocations at all (backend should give 403 unauthorized)
  2. The user doesn't have permission to view this particular job invocation (backend should give 404)
  3. The user has permission to view, but the job invocation doesn't exist (backend should give 404)
  4. The backend failing to process the request (think 500 ISE)

Should we distinguish 1 vs 2+3 vs 4?

With that being said, the old page showed "Not found" for all cases, except 4 so feel free treat this as optional.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would it make sense to include the backend message to the page? It could be more informative without us needing to introduce some parsing logic, wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if the backend says anything reasonable, but worth a try.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In some cases the backend adds a nice message like for case 3 »Resource job_invocation not found by id '88'«

<EmptyStateBody>
{sprintf(
__(
'There is no job invocation with id %s or there are access permissions needed. Please contact your administrator if this issue continues.'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we know what the permissions required are, should we list them as we do on the unauthorized page?


const jobInvocationsIndexPath = '/job_invocations';

const JobInvocationEmptyState = ({ jobInvocationId }) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AFAIR we have some patterns in core:

Should we re-use them instead of implementing a brand new specific page for it? I mean if they are not feasible, that's okay, I'm just asking if it was considered? I might lag behind our UI changes, so not sure if those aren't marked for future removal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did consider them, but found them a bit too restrictive. Otoh, if its worth it I can also extend them based on what we agree upon here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about them was too restrictive? might be worth to extend them as you said

@MariaAga MariaAga self-assigned this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants