GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — chore: add alias to the URI and listener rule by iamhopaul123 · Pull Request #2320 · aws/copilot-cli
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Conversation
|
| EnvStackParamOutput() (params map[string]string, outputs map[string]string, err error) | ||
| StackParamOutput() (params map[string]string, outputs map[string]string, err error) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This interface feels like is due a refactor. There are too many awkward things 😅
For example, StackParamOutput returns stack parameters and outputs but then we have a separate method for just returning the resources. It's not clear why it's separate.
The interface named svcDescriber also fetches outputs from the env stack which is peculiar 😆
Can we find a better separation? What about this:
type cfnStackDescriber interface { Params() (map[string]string, error) Outputs() (map[string]string, error) StackResources() ([]*cloudformation.StackResource, error) } type ecsSvcDescriber interface { cfnStackDescriber EnvVars() ([]*ecs.ContainerEnvVar, error) Secrets() ([]*ecs.ContainerSecret, error) } // implements cfnStackDescriber type envStackDescriber struct { ... } // implements ecsSvcDescriber type ecsSvcDescriber struct { ... }
Anyway it doesn't need to be like the above, but it would be great if we can refactor this interface a little.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Addressed!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2647e68 to
86b3e3e
Compare
86b3e3e to
881cc37
Compare
f102c45 to
3749557
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Wow all these merge conficts 😮
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| HTTPS bool | ||
| DNSNames []string // The environment's subdomain if the service is served on HTTPS. Otherwise, the public load balancer's DNS. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Wut 🤔 how can HTTPS be true and DNSNames be empty?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would make sense to instead have two different structs?
type HTTPendpoint struct and type HTTPSendpoint struct
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
00f402a to
e0c802c
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nice! some tiny refactor comments, once addressed feel free to remove the label!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| uris = append(uris, uri) | ||
| } | ||
| return strings.Join(uris, " or ") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
can we use: https://github.com/dustin/go-humanize#word-series ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
hmm why do we need this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
oooh i see nvm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| var uris []string | ||
| for _, dnsName := range u.DNSNames { | ||
| uri := "" | ||
| switch strconv.FormatBool(u.HTTPS) + "|" + strconv.FormatBool(u.Path == "/") { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this string conversion matrix?
protocol := "http://" if u.HTTPS { protocol = "https://" } path := "" if u.Path != "/" { path = fmt.Sprintf("/%s", u.Path) } uris = append(uris, fmt.Sprintf("%s%s%s", protocol, dnsName, path)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| // URI returns the LBWebServiceURI to identify this service uniquely given an environment name. | ||
| // URI returns the WebServiceURI to identify this service uniquely given an environment name. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit: this comment says "WebServiceURI" but it's from a "LBWebServiceURI" can we rename the type?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Mostly agreeing with Efe and two more questions ⬇️ choked
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ServiceStackResources() ([]*stack.Resource, error) | ||
| } | ||
|
|
||
| type stackDescriber interface { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
i wonder if it's worthy to define stackDescriber in a separate file since it's being used not only for service but also for app?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| // HumanString returns the stringified Resource struct with human readable format. | ||
| func (c Resource) HumanString() string { | ||
| return fmt.Sprintf(" %s\t%s\n", c.Type, c.PhysicalID) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's not a big deal but I think ideally we should probably let the caller add the extra spaces in front of of %s\t%s\n
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
thanks for the refactor!!!!!!!!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
<!-- Provide summary of changes --> Part of aws#1188. Preceding PR aws#2315. This PR: - add alias to the URI - add alias to the listener rule - enable path routing for HTTPS - move stack related behaviors in `describe` to `describe/stack` pkg <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.