Skip to content

Replace resolve_path() with os.path.join()#8646

Merged
natefoo merged 6 commits intogalaxyproject:devfrom
jdavcs:sg_kill_pathresolve
Sep 24, 2019
Merged

Replace resolve_path() with os.path.join()#8646
natefoo merged 6 commits intogalaxyproject:devfrom
jdavcs:sg_kill_pathresolve

Conversation

@jdavcs
Copy link
Member

@jdavcs jdavcs commented Sep 13, 2019

This is waiting on #8639 (first commit: 2762a9d)

Rationale for modification in commit message.

@jdavcs jdavcs added area/admin kind/refactoring cleanup or refactoring of existing code, no functional changes labels Sep 13, 2019
@jdavcs jdavcs requested a review from natefoo September 13, 2019 16:36
@galaxyproject galaxyproject deleted a comment from jdavcs Sep 16, 2019
@galaxyproject galaxyproject deleted a comment from jdavcs Sep 16, 2019
@jdavcs jdavcs removed the status/WIP label Sep 17, 2019
@galaxybot galaxybot added this to the 20.01 milestone Sep 17, 2019
@jdavcs jdavcs force-pushed the sg_kill_pathresolve branch from 352ca43 to dbaf928 Compare September 19, 2019 02:39
@jdavcs
Copy link
Member Author

jdavcs commented Sep 19, 2019

Rebased.

@jdavcs jdavcs added area/configuration Galaxy's configuration system and removed area/admin labels Sep 19, 2019
@jdavcs jdavcs force-pushed the sg_kill_pathresolve branch from dbaf928 to 901a3b6 Compare September 19, 2019 21:11
nsoranzo added a commit to nsoranzo/galaxy that referenced this pull request Sep 20, 2019
for config files.

Broken in galaxyproject#921 .

For context, see galaxyproject#8639 (comment)

Includes also elimination of `resolve_path` function as in
galaxyproject#8646
nsoranzo added a commit to nsoranzo/galaxy that referenced this pull request Sep 20, 2019
for config files.

Broken in galaxyproject#921 .

For context, see galaxyproject#8639 (comment)

Includes also elimination of `resolve_path` function as in
galaxyproject#8646
- Modify defaults in the schema so that correct values are loaded (add
  notes to description where applicable).
- When the default in schema was inconcsistent with the default loaded
  in `__init__.py`, use the latter.
- Replace `kwargs.get(foo, default)` with `self.foo` if default is set
  correctly in the schema.
- Remove redundant assignments and variables (there are still more
  left).
- The defalt for `citation_cache_lock_dir` should be `citations/locks`.
- In a few cases where defaults are NOT loaded in `__init__.py`, and the
  values are clearly meant to be suggested values, move those defaults
  into description.
As per discussion in code review.
This is just a hunch. The test shouldn't fail, and it doesn't fail
locally. It seems this might fix it (and point to the cause).
- Modify defaults in the schema so that correct values are loaded (add
  notes to description where applicable).
- When the default in schema was inconcsistent with the default loaded
  in `__init__.py`, use the latter.
- Replace `kwargs.get(foo, default)` with `self.foo` if default is set
  correctly in the schema.
- Remove redundant assignments and variables (there are still more
  left).
- The defalt for `citation_cache_lock_dir` should be `citations/locks`.
- In a few cases where defaults are NOT loaded in `__init__.py`, and the
  values are clearly meant to be suggested values, move those defaults
  into description.
The function was redundant: it checked whether its argument was an
absolute path, and if not, called os.path.join. This is exactly what
os.path.join already does (python 3.x and 2.7)

The only benefit of having a separate function is the ability to add
additinal processing to such calls - so when we need that, we can add
it. Meanwhile, it removes unnecessary function calls + makes the code
slightly less complex.

The function is not called from outside this module (not to be confused
with the resolve_path method of the mixin class), but it's duplicated in
webapps/reports/config.py and webapps/tool_shed/config.py (which are not
addressed in this commit).
@jdavcs jdavcs force-pushed the sg_kill_pathresolve branch from 70abac0 to cf0242d Compare September 23, 2019 20:07
@natefoo natefoo merged commit 4737bd0 into galaxyproject:dev Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/configuration Galaxy's configuration system kind/refactoring cleanup or refactoring of existing code, no functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants