hashicorp / hashicorp/nomad

[Feature Request] /search api endpoint should include job metadata

Open
#7,750 1 comment 3 reactions 0 assignees View on GitHub
theme/api type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

It would be nice to be able to search for all jobs that have a particular metadata in the job definition.

For example, at my company we add the following metadata to jobs.

```hcl
meta {
project_url = "<%= ENV['CI_PROJECT_URL'] %>"
branch = "<%= ENV['CI_COMMIT_REF_NAME'] %>"
ephemeral = "<%= ENV.fetch('EPHEMERAL', false) %>"
}
```

A ci process converts this to

```hcl
meta {
project_url = "gitlab.example.com"
branch = "feature_branch1"
ephemeral = "true"
}
```

We would like to use the `/search` api to search for all jobs that are more than 24 hours old, and have `ephemeral = true` set in them.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the `/search` API endpoint and how job-definition metadata is represented and queried. Define how searches for metadata such as `ephemeral = true` should combine with the requested age filter, then verify that the endpoint returns only matching jobs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.