Skip to content

Avoid accessing the configuration on import in the arcwrapper code.#350

Closed
albu-diku wants to merge 1 commit intonextfrom
refactor/arcwrapper-pass-configuration
Closed

Avoid accessing the configuration on import in the arcwrapper code.#350
albu-diku wants to merge 1 commit intonextfrom
refactor/arcwrapper-pass-configuration

Conversation

@albu-diku
Copy link
Contributor

This code is written to load a configuration object at its outer most level, meaning that any import causes trying to load a configuration which could well not exist. Worse, there are some places that unconditionally import this. As things stand there would be no way to test this and no way to pass a particular configuration to it.

Looking into this, all the uses of this code start by attempting to instantiate a class exposed by this code. This lead to the following idea: allow import to succeed but unilaterally error when trying to instantiate the object this relies on. All paths doing so already have error handling. This commit does that, leading to a rather minimal change which makes the configuration an argument to the constructor.

@jonasbardino
Copy link
Contributor

Thanks for trying, but I think it's time to simply retire the arcwrapper code. It's long gone from all active sites and surely completely outdated.

@albu-diku
Copy link
Contributor Author

Thanks for trying, but I think it's time to simply retire the arcwrapper code. It's long gone from all active sites and surely completely outdated.

Ok. To be honest I just needed to move this out of the way, so removal is also good. If you can confirm you'd be cool seeing a PR that removed al of this I will go ahead - if you let me know what needs to be done with the following callers I can proceed with that:

  • functionality/arcresources
  • functionality/autocreate
  • functionality/jobstatus
  • functionality/settings
  • gridscript
  • mrslparser

@jonasbardino
Copy link
Contributor

Thanks for trying, but I think it's time to simply retire the arcwrapper code. It's long gone from all active sites and surely completely outdated.

Ok. To be honest I just needed to move this out of the way, so removal is also good. If you can confirm you'd be cool seeing a PR that removed al of this I will go ahead - if you let me know what needs to be done with the following callers I can proceed with that:

* functionality/arcresources

* functionality/autocreate

* functionality/jobstatus

* functionality/settings

* gridscript

* mrslparser

A PR would be great, thanks.

mig/shared/functionality/arcresources, mig/shared/arcdummy.py and mig/shared/arcwrapper.py can just be removed.
In most of the other module like shared/configuration.py, mig/install/*, mig/shared/install.py, etc. all references to arcwrapper and even the related enable_griddk can also be completely removed.

I think a ./codegrep.py arcwrapper or similar on griddk will be helpful in finding all occurrences.
Feel free to ask me e.g. on chat if you encounter cases where correct removal is not obvious.

@albu-diku
Copy link
Contributor Author

This PR is replaced by a wholesale removal here: #359

@albu-diku albu-diku closed this Oct 10, 2025
@albu-diku albu-diku deleted the refactor/arcwrapper-pass-configuration branch January 27, 2026 16:03
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.

2 participants