• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

astronomer / astro-cli / fc632fcc-6f64-4bcc-a917-49c509c77432

28 Nov 2025 01:32AM UTC coverage: 39.41% (+6.3%) from 33.132%
fc632fcc-6f64-4bcc-a917-49c509c77432

Pull #1988

circleci

Simpcyclassy
Add Houston API 1.1.0 support - remove desiredRuntimeVersion and AC fields

- Add version 1.1.0 queries for DeploymentGetRequest
- Add version 1.1.0 queries for DeploymentsGetRequest
- Add version 1.1.0 queries for PaginatedDeploymentsGetRequest
- Add version 1.1.0 mutations for DeploymentCreateRequest
- Add version 1.1.0 mutations for DeploymentUpdateRequest
- Remove airflowVersion, desiredAirflowVersion, desiredRuntimeVersion fields
- Use runtimeVersion and runtimeAirflowVersion instead

Houston API 1.1.0 no longer returns desired version and AC fields.
All version information is now managed through runtimeVersion.
Pull Request #1988: Add Houston API 1.1.0 support - remove desiredRuntimeVersion and AC fields

23684 of 60096 relevant lines covered (39.41%)

11.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.61
/docker/parse.go
1
// Parse a dockerfile into a high-level representation using the official go parser
2
package docker
3

4
import (
5
        "io"
6
        "os"
7
        "sort"
8
        "strings"
9

10
        "github.com/distribution/reference"
11
        "github.com/moby/buildkit/frontend/dockerfile/command"
12
        "github.com/moby/buildkit/frontend/dockerfile/parser"
13
)
14

15
// Represents a single line (layer) in a Dockerfile.
16
// For example `FROM ubuntu:xenial`
17
type Command struct {
18
        Cmd       string   // lower cased command name (ex: `from`)
19
        SubCmd    string   // for ONBUILD only this holds the sub-command
20
        JSON      bool     // whether the value is written in json form
21
        Original  string   // The original source line
22
        StartLine int      // The original source line number which starts this command
23
        EndLine   int      // The original source line number which ends this command
24
        Flags     []string // Any flags such as `--from=...` for `COPY`.
25
        Value     []string // The contents of the command (ex: `ubuntu:xenial`)
26
}
27

28
// A failure in opening a file for reading.
29
type IOError struct {
30
        Msg string
31
}
32

33
func (e IOError) Error() string {
1✔
34
        return e.Msg
1✔
35
}
1✔
36

37
// A failure in parsing the file as a dockerfile.
38
type ParseError struct {
39
        Msg string
40
}
41

42
func (e ParseError) Error() string {
×
43
        return e.Msg
×
44
}
×
45

46
// List all legal cmds in a dockerfile
47
func AllCmds() []string {
1✔
48
        ret := make([]string, 0, len(command.Commands))
1✔
49
        for k := range command.Commands {
19✔
50
                ret = append(ret, k)
18✔
51
        }
18✔
52
        sort.Strings(ret)
1✔
53
        return ret
1✔
54
}
55

56
// Parse a Dockerfile from a reader.  A ParseError may occur.
57
func ParseReader(file io.Reader) ([]Command, error) {
3✔
58
        res, err := parser.Parse(file)
3✔
59
        if err != nil {
4✔
60
                return nil, ParseError{err.Error()}
1✔
61
        }
1✔
62

63
        ret := make([]Command, 0, len(res.AST.Children))
2✔
64
        for _, child := range res.AST.Children {
4✔
65
                cmd := Command{
2✔
66
                        Cmd:       child.Value,
2✔
67
                        Original:  child.Original,
2✔
68
                        StartLine: child.StartLine,
2✔
69
                        EndLine:   child.EndLine,
2✔
70
                        Flags:     child.Flags,
2✔
71
                }
2✔
72

2✔
73
                // Only happens for ONBUILD
2✔
74
                if child.Next != nil && len(child.Next.Children) > 0 {
2✔
75
                        cmd.SubCmd = child.Next.Children[0].Value
×
76
                        child = child.Next.Children[0]
×
77
                }
×
78

79
                cmd.JSON = child.Attributes["json"]
2✔
80
                for n := child.Next; n != nil; n = n.Next {
4✔
81
                        cmd.Value = append(cmd.Value, n.Value)
2✔
82
                }
2✔
83

84
                ret = append(ret, cmd)
2✔
85
        }
86
        return ret, nil
2✔
87
}
88

89
// ParseFile a Dockerfile from a filename.  An IOError or ParseError may occur.
90
var ParseFile = func(filename string) ([]Command, error) {
2✔
91
        file, err := os.Open(filename)
2✔
92
        if err != nil {
3✔
93
                return nil, IOError{err.Error()}
1✔
94
        }
1✔
95
        defer file.Close()
1✔
96

1✔
97
        return ParseReader(file)
1✔
98
}
99

100
// Parse image from parsed dockerfile:
101
// e.g. FROM ubuntu:xenial returns "ubuntu:xenial"
102
func GetImageFromParsedFile(cmds []Command) (image string) {
2✔
103
        for _, cmd := range cmds {
4✔
104
                if cmd.Cmd == command.From {
3✔
105
                        from := cmd.Value[0]
1✔
106
                        return from
1✔
107
                }
1✔
108
        }
109
        return ""
1✔
110
}
111

112
// Parse tag from parsed dockerfile:
113
// e.g. FROM ubuntu:xenial returns "ubuntu", "xenial"
114
func GetImageTagFromParsedFile(cmds []Command) (baseImage, tag string) {
2✔
115
        for _, cmd := range cmds {
4✔
116
                if strings.EqualFold(cmd.Cmd, command.From) {
3✔
117
                        from := cmd.Value[0]
1✔
118
                        baseImage, tag := parseImageName(from)
1✔
119
                        return baseImage, tag
1✔
120
                }
1✔
121
        }
122
        return "", ""
1✔
123
}
124

125
func parseImageName(imageName string) (baseImage, tag string) {
6✔
126
        ref, err := reference.Parse(imageName)
6✔
127
        if err != nil {
6✔
128
                return baseImage, tag
×
129
        }
×
130
        parsedName, ok := ref.(reference.Named)
6✔
131
        if ok {
12✔
132
                baseImage = parsedName.Name()
6✔
133
        }
6✔
134
        tag = "latest"
6✔
135
        parsedTag, ok := ref.(reference.Tagged)
6✔
136
        if ok {
10✔
137
                tag = parsedTag.Tag()
4✔
138
        }
4✔
139
        return baseImage, tag
6✔
140
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc