-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Upload files instead of multi-part form. (#127)
Upload issues and deps files instead of using multi-part form. Much simpler and more easily supports the addon staging the issues and deps files on disk rather than streaming. The more atomic approach will prevent transaction deadlock which can more easily occur when the addon-analyzer builder reported an error (which it should never do). Requires: konveyor/tackle2-hub#743 --------- Signed-off-by: Jeff Ortel <[email protected]>
- Loading branch information
Showing
7 changed files
with
83 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package builder | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/konveyor/tackle2-hub/api" | ||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
// Manifest file. | ||
type Manifest struct { | ||
Analysis api.Analysis | ||
Issues *Issues | ||
Deps *Deps | ||
Path string | ||
} | ||
|
||
// Write manifest file. | ||
func (m *Manifest) Write() (err error) { | ||
m.Path = "manifest.yaml" | ||
file, err := os.Create(m.Path) | ||
if err != nil { | ||
return | ||
} | ||
defer func() { | ||
_ = file.Close() | ||
}() | ||
_, _ = file.Write([]byte(api.BeginMainMarker)) | ||
_, _ = file.Write([]byte{'\n'}) | ||
encoder := yaml.NewEncoder(file) | ||
err = encoder.Encode(m.Analysis) | ||
if err != nil { | ||
return | ||
} | ||
_, _ = file.Write([]byte(api.EndMainMarker)) | ||
_, _ = file.Write([]byte{'\n'}) | ||
err = m.Issues.Write(file) | ||
if err != nil { | ||
return | ||
} | ||
err = m.Deps.Write(file) | ||
if err != nil { | ||
return | ||
} | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters