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

Automations: Non-UK airfield AIRAC sector file update #881

Closed
luke11brown opened this issue Oct 4, 2024 · 6 comments · Fixed by #897
Closed

Automations: Non-UK airfield AIRAC sector file update #881

luke11brown opened this issue Oct 4, 2024 · 6 comments · Fixed by #897
Assignees
Labels
bug For bugs in existing functionality

Comments

@luke11brown
Copy link
Contributor

luke11brown commented Oct 4, 2024

What is the bug?

Auto AIRAC action script updates airfields such as Akrotiri to use latest UK Sector file.

How to reproduce?

Run workflow

Additional context

Overseas airfields that don't use the UK sector file need to be excluded from the GitHub action

@luke11brown luke11brown added bug For bugs in existing functionality up-for-grabs Unassigned labels Oct 4, 2024
@19wintersp

This comment has been minimized.

@kristiankunc
Copy link
Contributor

The filename of the other sct files does not start with "UK_" (Akrotiri LCRA.sct) so this condition should not include it, not sure how it happens? Is it possible the Akrotiri SCT had a different name during the run?

for root, dirs, files in os.walk(self.ukcp_location):
for file_name in files:
if file_name.endswith(".sct") and file_name.startswith("UK_"):
sector_file.append(os.path.join(root, file_name))

@19wintersp
Copy link
Contributor

@kristiankunc I'm speaking from guesswork as I haven't actually run that script, but are you not looking at the wrong bit there (searching for the SCT in the SF release artifact)? I believe the script just does a blanket search for any profile containing "Settings\tsector\t" and replaces it with the new UK SCT path, ignoring what SCT is referenced afterwards.

@kristiankunc
Copy link
Contributor

kristiankunc commented Oct 6, 2024

@19wintersp Just tried running the script without any problems (main @ 873c46b)

Logs
2024-10-07 00:04:10.443 | INFO     | __main__:get_sector_file:204 - Sector file found at UK/Data/Sector/UK_2024_10.sct
2024-10-07 00:04:10.443 | DEBUG    | __main__:wrapper:184 - Found UK/Channel Islands/Jersey.prf
2024-10-07 00:04:10.443 | DEBUG    | __main__:wrapper:184 - Found UK/Edinburgh/Edinburgh SMR.prf
2024-10-07 00:04:10.443 | DEBUG    | __main__:wrapper:184 - Found UK/Edinburgh/Edinburgh.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Birmingham/Birmingham SMR.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Birmingham/Birmingham.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Birmingham/Birmingham ATM.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London TC/TC North.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London TC/TC Bandbox.prf
2024-10-07 00:04:10.444 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London TC/TC South.prf
2024-10-07 00:04:10.445 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London TC/TC Midlands.prf
2024-10-07 00:04:10.445 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London TC/TC East.prf
2024-10-07 00:04:10.445 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Manchester PC/PC Bandbox.prf
2024-10-07 00:04:10.445 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Scottish Lower/Scottish Lower.prf
2024-10-07 00:04:10.445 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Scottish Upper/Area (iTEC).prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Scottish Upper/Area (NERC).prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Scottish Upper/Area SMR.prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/Scottish Upper/Area.prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/Central.prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/North.prf
2024-10-07 00:04:10.446 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/South SMR.prf
2024-10-07 00:04:10.447 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/South Central.prf
2024-10-07 00:04:10.447 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/South Central SMR.prf
2024-10-07 00:04:10.447 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/North SMR.prf
2024-10-07 00:04:10.447 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/Bandbox.prf
2024-10-07 00:04:10.447 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/Bandbox SMR.prf
2024-10-07 00:04:10.448 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/West.prf
2024-10-07 00:04:10.448 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/Central SMR.prf
2024-10-07 00:04:10.448 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/West SMR.prf
2024-10-07 00:04:10.448 | DEBUG    | __main__:wrapper:184 - Found UK/Area/London AC/South.prf
2024-10-07 00:04:10.448 | DEBUG    | __main__:wrapper:184 - Found UK/Heathrow/Heathrow.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Heathrow/Heathrow ATM.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Heathrow/Heathrow SMR.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Thames/London City SMR.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Thames/Biggin SMR.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Thames/Southend.prf
2024-10-07 00:04:10.449 | DEBUG    | __main__:wrapper:184 - Found UK/Thames/Thames.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Bristol/Bristol.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Bristol/Bristol SMR.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Newcastle/Newcastle.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Newcastle/Newcastle SMR.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Oxford/Oxford.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Military/Military APC.prf
2024-10-07 00:04:10.450 | DEBUG    | __main__:wrapper:184 - Found UK/Military/Akrotiri.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Belfast/Belfast.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Belfast/Belfast City SMR.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Belfast/Aldergrove SMR.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Manchester/Manchester.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Manchester/Manchester SMR.prf
2024-10-07 00:04:10.451 | DEBUG    | __main__:wrapper:184 - Found UK/Manchester/Manchester ATM.prf
2024-10-07 00:04:10.452 | DEBUG    | __main__:wrapper:184 - Found UK/Generic/Generic SMR.prf
2024-10-07 00:04:10.452 | DEBUG    | __main__:wrapper:184 - Found UK/Generic/Generic Radar.prf
2024-10-07 00:04:10.452 | DEBUG    | __main__:wrapper:184 - Found UK/Gatwick/Gatwick.prf
2024-10-07 00:04:10.452 | DEBUG    | __main__:wrapper:184 - Found UK/Gatwick/Gatwick SMR.prf
2024-10-07 00:04:10.452 | DEBUG    | __main__:wrapper:184 - Found UK/Gatwick/Gatwick ATM.prf
2024-10-07 00:04:10.454 | DEBUG    | __main__:wrapper:184 - Found UK/Glasgow/Glasgow SMR.prf
2024-10-07 00:04:10.454 | DEBUG    | __main__:wrapper:184 - Found UK/Glasgow/Glasgow.prf
2024-10-07 00:04:10.454 | DEBUG    | __main__:wrapper:184 - Found UK/Liverpool/Liverpool SMR.prf
2024-10-07 00:04:10.454 | DEBUG    | __main__:wrapper:184 - Found UK/Liverpool/Liverpool ATM.prf
2024-10-07 00:04:10.454 | DEBUG    | __main__:wrapper:184 - Found UK/Liverpool/Liverpool.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/East Midlands/East Midlands SMR.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/East Midlands/East Midlands ATM.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/East Midlands/East Midlands.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/Aberdeen/Aberdeen SMR.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/Aberdeen/Aberdeen.prf
2024-10-07 00:04:10.455 | DEBUG    | __main__:wrapper:184 - Found UK/Exeter/Exeter.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Cardiff/Cardiff SMR.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Cardiff/Cardiff.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Cardiff/St Athan SMR.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Luton SMR.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Luton ATM.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Stansted SMR.prf
2024-10-07 00:04:10.456 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Stansted ATM.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Cambridge SMR.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Luton.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Stansted.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Essex/Essex.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Procedural + AFIS AG/Flight Information Display.prf
2024-10-07 00:04:10.457 | DEBUG    | __main__:wrapper:184 - Found UK/Leeds/Leeds SMR.prf
2024-10-07 00:04:10.458 | DEBUG    | __main__:wrapper:184 - Found UK/Leeds/Leeds.prf
2024-10-07 00:04:10.458 | DEBUG    | __main__:wrapper:184 - Found UK/Solent/Bournemouth SMR.prf
2024-10-07 00:04:10.458 | DEBUG    | __main__:wrapper:184 - Found UK/Solent/Southampton SMR.prf
2024-10-07 00:04:10.458 | DEBUG    | __main__:wrapper:184 - Found UK/Solent/Solent Radar.prf
2024-10-07 00:04:10.710 | DEBUG    | __main__:gng_data_update:108 - Full list of found zip file urls: ['https://files.aero-nav.com/EGTT/UK-Datafiles_20241004040032-241001-1.zip']
2024-10-07 00:04:10.710 | INFO     | __main__:gng_data_update:110 - Selected zip file url is https://files.aero-nav.com/EGTT/UK-Datafiles_20241004040032-241001-1.zip
2024-10-07 00:04:16.402 | DEBUG    | __main__:gng_data_update:130 - Response Status = 200
2024-10-07 00:04:16.413 | DEBUG    | __main__:gng_data_update:134 - File navdata.zip has been written
2024-10-07 00:04:16.651 | DEBUG    | __main__:gng_data_update:141 - Extracted navdata.zip
2024-10-07 00:04:16.653 | DEBUG    | __main__:gng_data_update:145 - Removed navadata.zip
2024-10-07 00:04:16.654 | SUCCESS  | __main__:gng_data_update:167 - Moved ICAO/ICAO_Aircraft.txt
2024-10-07 00:04:16.657 | SUCCESS  | __main__:gng_data_update:167 - Moved ICAO/ICAO_Airlines.txt
2024-10-07 00:04:16.659 | SUCCESS  | __main__:gng_data_update:167 - Moved ICAO/ICAO_Airports.txt
2024-10-07 00:04:16.801 | SUCCESS  | __main__:gng_data_update:167 - Moved NavData/airway.txt
2024-10-07 00:04:16.803 | SUCCESS  | __main__:gng_data_update:167 - Moved NavData/icao.txt
2024-10-07 00:04:16.812 | SUCCESS  | __main__:gng_data_update:167 - Moved NavData/isec.txt
2024-10-07 00:04:16.818 | DEBUG    | __main__:gng_data_update:171 - Cleaned up import directory

@19wintersp
Copy link
Contributor

19wintersp commented Oct 7, 2024

@kristiankunc :trout:

bash

image

The action was run in 873c46b so the script evidently wouldn't do anything there if run again on it (SF is already up-to-date etc.); this example done detached at d85e146.

Easy fix as follows:

- content = re.sub(r"^Settings\tsector\t(.*)", sf_replace, line)
+ content = re.sub(r"^Settings\tsector\t.*UK.+", sf_replace, line)

@luke11brown
Copy link
Contributor Author

2024-10-07 00:04:10.450 | DEBUG | main:wrapper:184 - Found UK/Military/Akrotiri.prf

In your log the script has detected the Akrotiri.prf. As this profile doesn't use the UK sector file, we want it to be ignored.

@kristiankunc :trout:

bash
The action was run in 873c46b so the script evidently wouldn't do anything there if run again on it (SF is already up-to-date etc.); this example done detached at d85e146.

Easy fix as follows:

- content = re.sub(r"^Settings\tsector\t(.*)", sf_replace, line)
+ content = re.sub(r"^Settings\tsector\t.*UK.+", sf_replace, line)

It's kinda jank, but it's not stupid if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs in existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants