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

Leaf 4486 - user name disabled update #2644

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

jampaul3
Copy link
Contributor

@jampaul3 jampaul3 commented Jan 9, 2025

Summary: The old script, which resides on the Auth server processed all Active Directory updates to Leaf. Now the Auth Server will get the data from AD and save it to a table (cache) in the National Orgchart. Then a cron job on Leaf servers runs to update Employee data in the national orgchart. After this update is complete another script runs to disable Employees that have not been updated within the last 30 hours.

For the purposes of this PR an Employee is considered disabled if their record in the National Orgchart hasn't been updated within the last 30 hours. Every Employee has a lastUpdated field and this gets updated whenever the script runs to update Employees whether or not they had data to be updated, if it hasn't been updated they were not pulled from AD which means that userName is no longer being used and needs to be disabled.

There is also a fail safe when updating disabled Employees, the script looks to make sure that at least 200k Employee's have been updated within the last 2 hours before attempting to disable anyone.

graph TB
    subgraph Active_Directory_Namespace
        AD_agent(Active Directory Server)
    end

    subgraph Auth_Server
        auth_server(import script)
    end

    subgraph Leaf_Server
        national_update(update National<br />Orgchart)
        national_disable(disable National Orgchart<br />Employees)
        local_updates(refresh local<br />orgchart and portals)
    end

    subgraph leaf.va.gov
        disable_button(Disable)
        enable_button(Enable)
    end

    national_orgchart[(National Orgchart)]
    local_orgcharts_portals[(Local Orgcharts<br /> and Portals)]

    auth_server o-- Get data<br /> from AD --o AD_agent
    auth_server -- Save data to<br />cache table --> national_orgchart
    national_update <-- Update Employee table from AD data in cache table --> national_orgchart
    national_disable <-- Disable Employees who have not been updated within the last 30 hours --> national_orgchart
    local_updates o-- Refresh local orgcharts and portals --o local_orgcharts_portals
    disable_button o-- Disables selected Employee in orgchart and 4 tables in all portals --o local_orgcharts_portals
    enable_button o--Enables selected Employee in orgchart and 4 tables in all portals --o local_orgcharts_portals
Loading

@jampaul3 jampaul3 self-assigned this Jan 9, 2025
@jampaul3 jampaul3 changed the base branch from master to dev January 9, 2025 16:22
Copy link
Contributor

@shaneodd shaneodd left a comment

Choose a reason for hiding this comment

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

For the refreshOrgchart, I would put a message of why it is exiting. Or remove the file all together if we are not using it.

@jampaul3
Copy link
Contributor Author

@shaneodd I removed the exit. I did that so I could easily stop the cron jobs. This is now back to normal.

@jampaul3 jampaul3 requested a review from shaneodd January 14, 2025 14:35
Pelentan
Pelentan previously approved these changes Jan 17, 2025
Pelentan
Pelentan previously approved these changes Jan 21, 2025
shaneodd
shaneodd previously approved these changes Jan 21, 2025
@jampaul3 jampaul3 dismissed stale reviews from shaneodd and Pelentan via 1b458f8 January 24, 2025 19:15
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