Skip to content

Comments

AP-468 add priority job feature#3

Merged
steve-sullivan merged 1 commit intomainfrom
AP-468-SLFN
Feb 12, 2026
Merged

AP-468 add priority job feature#3
steve-sullivan merged 1 commit intomainfrom
AP-468-SLFN

Conversation

@steve-sullivan
Copy link
Contributor

No description provided.

end

def map_job_to_struct(job_hash)
OpenStruct.new(

Choose a reason for hiding this comment

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

OpenStruct is deprecated and will be removed from Ruby 3.5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UGH...yeah. I'll open a ticket to eventually move from openstructs to structs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note - opened AP-584 for that work.

def find_priority_jobs(job_list)
job_list.flatten.find do |jh|
job_code = jh.dig('position', 'jobCode', 'code', 'code')
status = jh.dig('position', 'active', 'code')

Choose a reason for hiding this comment

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

Maybe, i'm not reading this right but should it be status = jh.dig('position', 'status', 'code'). Is it parsing ucpath_fields.yml?

Copy link
Contributor Author

@steve-sullivan steve-sullivan Feb 11, 2026

Choose a reason for hiding this comment

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

You'd think... but nope, here's the JSON from the API:

"position": {
        ...
	"active": {
		"code": "A",
		"description": "Active"
	},
	...
},

Copy link
Member

Choose a reason for hiding this comment

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

i'm a little confused by this too - i din't think it's parsing that file, but i see a similar json path in that file. how are these two things related?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maria is correct, it's not parsing ucpath_fields.yml. The new function (find_priority_jobs) is going through the JSON that is returned from the UCPath/Jobs API (looking for any job that is active and in the priority list).

The JSONPath (from ucpath_fields.yml) is used to map data fields from the job hash (from the API) into an OpenStruct which gets passed back to the user object for further processing.

Copy link
Member

@anarchivist anarchivist left a comment

Choose a reason for hiding this comment

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

generally looking good - a few comments


# These jobs will always be considered "eligible" regardless
# of any student affiliations
Priority Job Codes:
Copy link
Member

Choose a reason for hiding this comment

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

i know we had this before, but i'm a little concerned about YAML keys containing spaces - could we rename this something like priority_job_codes or something similar? (i know we need to make similar changes throughout this file and in the code, too.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - that's definitely doable!

def find_priority_jobs(job_list)
job_list.flatten.find do |jh|
job_code = jh.dig('position', 'jobCode', 'code', 'code')
status = jh.dig('position', 'active', 'code')
Copy link
Member

Choose a reason for hiding this comment

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

i'm a little confused by this too - i din't think it's parsing that file, but i see a similar json path in that file. how are these two things related?

@steve-sullivan steve-sullivan merged commit 42c8190 into main Feb 12, 2026
5 checks passed
@steve-sullivan steve-sullivan deleted the AP-468-SLFN branch February 12, 2026 00:55
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.

3 participants