Skip to content

Conversation

@chlowell
Copy link
Member

@chlowell chlowell commented Aug 19, 2024

This fixes a couple problems causing apiviewgo to fail when run by APIView:

  • os.UserHomeDir returns an unwriteable path on APIView's production VMs. Fixed this by instead (trying to) write to os.TempDir (%TMPDIR% is writeable on those VMs)
  • Code for computing a package's name relative to its module (e.g. "azcore/log") assumed the module name appears exactly once in the module's disk path and that the disk path includes the module path verbatim. Neither assumption holds true for downloaded code, and in general disk and module paths are unrelated. Fixed this by making module and disk path separate parameters of NewPkg() (this is much simpler than having NewPkg() figure out the difference)

@praveenkuttappan praveenkuttappan changed the base branch from main to hotfix/apiview_aug_2024 August 23, 2024 17:35
@praveenkuttappan praveenkuttappan changed the base branch from hotfix/apiview_aug_2024 to htofix/apiview_main_before_schema August 23, 2024 17:46
@chlowell chlowell changed the title apiviewgo downloads to os.TempDir instead of os.UserHomeDir Fix apiviewgo download paths Aug 23, 2024
@chlowell chlowell marked this pull request as ready for review August 23, 2024 18:41
@RickWinter RickWinter added APIView Issues related to APIView core functionality or UI Go labels Aug 23, 2024
@praveenkuttappan praveenkuttappan merged commit 6ae6d96 into Azure:htofix/apiview_main_before_schema Aug 23, 2024
praveenkuttappan added a commit that referenced this pull request Aug 26, 2024
* apiviewgo downloads to os.TempDir instead of os.UserHomeDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APIView Issues related to APIView core functionality or UI Go

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants