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

Backport of [ui] bugfix: when hitting the "start" button on a job page, if it has no submission data, fallback to raw json definition into release/1.6.x #18625

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/18621.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: using start/stop from the job page in the UI will no longer fail when the job lacks HCL submission data
```
13 changes: 11 additions & 2 deletions ui/app/components/job-page/parts/title.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ export default class Title extends Component {
*/
@task(function* (withNotifications = false) {
const job = this.job;
const specification = yield job.fetchRawSpecification();
job.set('_newDefinition', specification.Source);

// Try to get the submission/hcl sourced specification first.
// In the event that this fails, fall back to the raw definition.
try {
const specification = yield job.fetchRawSpecification();
job.set('_newDefinition', specification.Source);
} catch {
const definition = yield job.fetchRawDefinition();
delete definition.Stop;
job.set('_newDefinition', JSON.stringify(definition));
}

try {
yield job.parse();
Expand Down
Loading